Skip to content

Commit a041ec2

Browse files
committed
fixes for #11 upgrade to hz 3.6.4, consul 0.12.5
1 parent fa99178 commit a041ec2

File tree

7 files changed

+25
-21
lines changed

7 files changed

+25
-21
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ This is an easy to configure plug-and-play Hazlecast DiscoveryStrategy that will
2020

2121
## <a id="status"></a>Status
2222

23-
This is beta code, tested against Hazelcast 3.6-EA+ through 3.6 Stable releases.
23+
This is release candidate code, tested against Hazelcast 3.6-EA+ through 3.6.x Stable releases.
2424

2525
## <a id="releases"></a>Releases
2626

2727
* MASTER - in progress, this README refers to what is in the master tag. Switch to relevant RELEASE tag above to see that versions README
2828

29+
* [1.0-RC5](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/releases/tag/1.0-RC5): Upgrade to latest consul-client [#11](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/issues/11) Tested against Hazelcast 3.6-EA+ through 3.6.4+ Stable releases
30+
2931
* [1.0-RC4](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/releases/tag/1.0-RC4): Adds support for TCP/HTTP checks [#3](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/issues/3) Tested against Hazelcast 3.6-EA+ through 3.6 Stable releases
3032

3133
* [1.0-RC3](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/releases/tag/1.0-RC3): Adds support for TLS [#2](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/issues/2) and Consul ACLs [#4](https://github.com/bitsofinfo/hazelcast-consul-discovery-spi/issues/4) Tested against Hazelcast 3.6-EA+ through 3.6 Stable releases
@@ -52,7 +54,7 @@ repositories {
5254
}
5355
5456
dependencies {
55-
compile 'org.bitsofinfo:hazelcast-consul-discovery-spi:1.0-RC4'
57+
compile 'org.bitsofinfo:hazelcast-consul-discovery-spi:1.0-RC5'
5658
5759
// include your preferred javax.ws.rs-api implementation
5860
// (for the OrbitzWorldwide/consul-client dependency)
@@ -69,7 +71,7 @@ dependencies {
6971
<dependency>
7072
<groupId>org.bitsofinfo</groupId>
7173
<artifactId>hazelcast-consul-discovery-spi</artifactId>
72-
<version>1.0-RC4</version>
74+
<version>1.0-RC5</version>
7375
</dependency>
7476
7577
<!-- include your preferred javax.ws.rs-api

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ targetCompatibility = 1.6
2424

2525
dependencies {
2626

27-
compile group: 'com.hazelcast', name: 'hazelcast', version:'3.6'
28-
compile group: 'com.orbitz.consul', name: 'consul-client', version:'0.10.0'
27+
compile group: 'com.hazelcast', name: 'hazelcast', version:'3.6.4'
28+
compile group: 'com.orbitz.consul', name: 'consul-client', version:'0.12.5'
2929

3030
// for consul-client
3131
testCompile 'org.apache.cxf:cxf-rt-rs-client:3.0.3'
3232
testCompile 'org.apache.cxf:cxf-rt-transports-http-hc:3.0.3'
3333
testCompile 'junit:junit:4.12'
34-
34+
3535
}
3636

3737
bintray {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=1.0-RC4
1+
version=1.0-RC5
22
description=hazelcast-consul-discovery-spi - Consul based discovery strategy SPI for Hazelcast enabled applications

src/main/java/org/bitsofinfo/hazelcast/discovery/consul/ConsulClientBuilder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import javax.net.ssl.SSLSession;
1414
import javax.net.ssl.TrustManager;
1515
import javax.net.ssl.TrustManagerFactory;
16-
import javax.ws.rs.client.ClientBuilder;
1716

1817
import com.google.common.net.HostAndPort;
1918
import com.hazelcast.logging.ILogger;
@@ -55,12 +54,13 @@ public Consul buildConsul(
5554
}
5655

5756
if (!consulServerHostnameVerify) {
57+
5858
//We don't want verify host name, so we will mark host name as verified
59-
consulBuilder.withClientBuilder(ClientBuilder.newBuilder().hostnameVerifier(new HostnameVerifier() {
60-
public boolean verify(String s, SSLSession sslSession) {
61-
return true;
62-
}
63-
}));
59+
consulBuilder.withHostnameVerifier(new HostnameVerifier() {
60+
public boolean verify(String s, SSLSession sslSession) {
61+
return true;
62+
}
63+
});
6464
}
6565
} else {
6666
//Normal http without TLS

src/main/java/org/bitsofinfo/hazelcast/discovery/consul/ConsulDiscoveryStrategy.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import java.util.List;
66
import java.util.Map;
77

8-
import com.fasterxml.jackson.core.JsonFactory;
9-
import com.fasterxml.jackson.core.type.TypeReference;
10-
import com.fasterxml.jackson.databind.ObjectMapper;
8+
import com.orbitz.fasterxml.jackson.core.JsonFactory;
9+
import com.orbitz.fasterxml.jackson.core.type.TypeReference;
10+
import com.orbitz.fasterxml.jackson.databind.ObjectMapper;
1111
import com.hazelcast.logging.ILogger;
1212
import com.hazelcast.nio.Address;
1313
import com.hazelcast.spi.discovery.AbstractDiscoveryStrategy;
@@ -20,6 +20,7 @@
2020
import com.orbitz.consul.model.catalog.CatalogService;
2121
import com.orbitz.consul.model.health.ServiceHealth;
2222

23+
2324
/**
2425
* DiscoveryStrategy for Consul
2526
*
@@ -99,6 +100,7 @@ public ConsulDiscoveryStrategy(DiscoveryNode localDiscoveryNode, ILogger logger,
99100
Map<String,Object> registratorConfig = null;
100101
if (registratorConfigJSON != null && !registratorConfigJSON.trim().isEmpty()) {
101102
try {
103+
102104
JsonFactory factory = new JsonFactory();
103105
ObjectMapper mapper = new ObjectMapper(factory);
104106
TypeReference<HashMap<String,Object>> typeRef

src/main/resources/explicitIpPortRegistrator-example.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<property name="consul-registrator">org.bitsofinfo.hazelcast.discovery.consul.ExplicitIpPortRegistrator</property>
4747
<property name="consul-registrator-config"><![CDATA[
4848
{
49-
"registerWithIpAddress":"192.168.0.208",
49+
"registerWithIpAddress":"192.168.1.102",
5050
"registerWithPort":5701,
5151
"healthCheckProvider":"org.bitsofinfo.hazelcast.discovery.consul.ScriptHealthCheckBuilder",
5252
"healthCheckScript":"exec 6<>/dev/tcp/#MYIP/#MYPORT || (exit 3)",

src/main/resources/hazelcast-consul-discovery-spi-example.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@
256256
this node's IP/PORT (port being hazelcast port)
257257
258258
- healthCheckTcpIntervalSeconds: self explanatory
259-
-->
259+
260260
<property name="consul-registrator-config"><![CDATA[
261261
{
262-
"registerWithIpAddress":"192.168.0.208",
262+
"registerWithIpAddress":"192.168.1.102",
263263
"registerWithPort":5701,
264264
"healthCheckProvider":"org.bitsofinfo.hazelcast.discovery.consul.HttpHealthCheckBuilder",
265265
"healthCheckScript":"exec 6<>/dev/tcp/#MYIP/#MYPORT || (exit 3)",
@@ -270,8 +270,8 @@
270270
"healthCheckTcpIntervalSeconds":30
271271
}
272272
]]></property>
273-
-->
274-
273+
274+
-->
275275

276276
</properties>
277277
</discovery-strategy>

0 commit comments

Comments
 (0)