Hazelcast client example

Hello there! :wink:

I’m trying to create a Hazelcast listener based on zeebe-hazelcast-exporter Java example. Unfortunately, no ClientConfig or HazelcastClient classes are found.

Maybe there should be more dependencies specified?

Hi @Gorynych, you could check out Zeebe Simple Monitor, which uses Hazelcast.

Josh

Thanks @jwulf.

Yes, it looks like I have to specify dependency on hazelcast:4.0.1 explicitly.

So, now I’m just trying to connect (like example say me, and like Simple Monitor do), and receiving Unknown protocol: CP2 exception :frowning:

  2020-06-08 15:45:15.100 [] [hz._hzInstance_1_dev.IO.thread-in-1] WARN  com.hazelcast.nio.tcp.TcpIpConnection - [172.23.0.4]:5701 [dev] [3.12.6] Connection[id=2, /172.23.0.4:5701->/172.23.0.1:53586, qualifier=null, endpoint=null, alive=false, type=NONE] closed. Reason: Exception in Connection[id=2, /172.23.0.4:5701->/172.23.0.1:53586, qualifier=null, endpoint=null, alive=true, type=NONE], thread=hz._hzInstance_1_dev.IO.thread-in-1
  java.lang.IllegalStateException: Unknown protocol: CP2
    at com.hazelcast.nio.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:107) ~[zeebe-hazelcast-exporter.jar:0.8.0]
    at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:135) ~[zeebe-hazelcast-exporter.jar:0.8.0]
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:369) [zeebe-hazelcast-exporter.jar:0.8.0]
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:354) [zeebe-hazelcast-exporter.jar:0.8.0]
    at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:280) [zeebe-hazelcast-exporter.jar:0.8.0]
    at com.hazelcast.internal.networking.nio.NioThread.run(NioThread.java:235) [zeebe-hazelcast-exporter.jar:0.8.0]

Zeebe: 0.23.1, running with this docker-compose

Ha!

And the same for zeebe-simple-monitor. It works if I start it from docker image, but fails with the same exception if I just start it with IDEA.

Hi @Gorynych, you get this exception if you try to connect Hazelcast client/instance 3.x with 4.x. Please make sure that all Hazelcast clients and instances running on 4.0.1.

Since Hazelcast exporter version 0.9.0, it uses Hazelcast 4.0.1.

Thanks @philipp.ossler! So, am I got it right - camunda/zeebe:0.23.1 docker image use Hazelcast instance version 3.x, but I’m using zeebe-hazelcast-connector:0.9.0 with client version 4.x?

PS: Yeah, this is what I have found in zeebe logs:

  Hazelcast 3.12.6 (20200130 - be02cc5) starting at [172.20.0.6]:5701

For those who interested in: solution is to specify dependency on com.hazelcast:hazelcast-client:3.12.7

3 Likes