Hazelcast topic - messages seem to be sent from only one member

225 views
Skip to first unread message

Ceyhan Kasap

unread,
Feb 12, 2018, 1:17:49 AM2/12/18
to Hazelcast
Hi, 

I am using hazelcast cluster in client server mode. There are two members in the cluster.

From one client, I am publishing messages to topic and from other clients  I am trying to receive messages from the topic.

In management center , it is shown that all operations are performed in only one instance.



Is this the expected behavior ? I would expect publishes and receives in both members

Regards

M. Sancar Koyunlu

unread,
Feb 12, 2018, 3:59:56 AM2/12/18
to haze...@googlegroups.com
Hi Ceyhan, 

In short, yes it is expected behavior.
If you are curious here is more details:
The client sends topic `publish` messages to the partition owner. So publishes of the same topic will always on the same member(unless partition table changes). 
If smart routing enabled(default behavior), the client registers listeners to all members. And listens only local events. Soo all receives will be from the member that publish happens from. 
If smart routing disabled, the client will register a listener to a random member. And all receives will be on that random member. 

Regards. 

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/dca6b5e3-704f-42d6-bc12-65e9e2795d0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sancar Koyunlu
Software Engineer, Hazelcast

Ceyhan Kasap

unread,
Feb 14, 2018, 1:59:53 AM2/14/18
to Hazelcast
Hi Sancar,

Thanks for the response. So does that mean that topic is safe from split brain problems? Since topic is non partitioned there is no danger of split brain , am I wrong?

Regards

12 Şubat 2018 Pazartesi 11:59:56 UTC+3 tarihinde M. Sancar Koyunlu yazdı:

M. Sancar Koyunlu

unread,
Feb 14, 2018, 3:30:58 AM2/14/18
to haze...@googlegroups.com
In split-brain, the client will be connected to only one half of the cluster. So publishes and receives will be to/from to one half of the cluster. 
Also, on the member's side, split-brain means there will be two clusters. Each will work as different clusters. One half will not be aware of publishes of the other half during the split. 



For more options, visit https://groups.google.com/d/optout.

Sertuğ Kaya

unread,
Feb 14, 2018, 5:28:03 AM2/14/18
to Hazelcast
Ceyhan;

In addition to Sancar's response; Hazelcast has some Split Brain protection & recovery mechanisms and it has support for some of the data structures, Topic is not supported but it's in the roadmap to have this support for all data structures in the future versions. See details here: http://docs.hazelcast.org/docs/3.9.2/manual/html-single/#split-brain-syndrome

Ceyhan Kasap

unread,
Feb 14, 2018, 6:09:06 AM2/14/18
to Hazelcast
Hi,

I am using client to client messaging using topic. 

 So publishes and receives will be to/from to one half of the cluster. 

Is this a problem? As far as I understand current pusblishes & receives are already performed from one member since topic is non partitioned ...

14 Şubat 2018 Çarşamba 11:30:58 UTC+3 tarihinde M. Sancar Koyunlu yazdı:

M. Sancar Koyunlu

unread,
Feb 14, 2018, 10:43:38 AM2/14/18
to haze...@googlegroups.com
Let's say you have 2 members M1 M2 and 2 clients C1 and C2. 
When M1 and M2 are split, it is possible that C1 will stay connected to M1 and disconnected from M2. Let's say,  C2 stayed connected to M2 and disconnected from M1. 
In this case, messages published by C1 will not be received by C2, because there is no connection from M1 to M2. 



For more options, visit https://groups.google.com/d/optout.

Ceyhan Kasap

unread,
Feb 15, 2018, 12:15:07 AM2/15/18
to Hazelcast
Hi,
Thanks for the detailed explanation

14 Şubat 2018 Çarşamba 18:43:38 UTC+3 tarihinde M. Sancar Koyunlu yazdı:
Reply all
Reply to author
Forward
0 new messages