Hazelcast: MessageListener gets Messages for all Topics

13 views
Skip to first unread message

Ulrich Mayring

unread,
Aug 28, 2017, 11:39:56 AM8/28/17
to Payara Forum
This may be better placed in a Hazelcast forum, if so perhaps someone can give me a pointer to that.

Anyways, I have two Topics configured as such:

<ringbuffer name="Topic1">
 
<capacity>1000</capacity>
 
<time-to-live-seconds>86400</time-to-live-seconds>
</ringbuffer>

<reliable-topic name="Topic1">
 
<topic-overload-policy>DISCARD_OLDEST</topic-overload-policy>
</reliable-topic>.

The second has the same config, just a different name ("Topic2").

I've written a MessageListener and registered it to Topic1 like so:

ITopic<MyType> topic1 = hazelcast.getTopic("Topic1");
topic1.addMessageListener(this);
...
public void onMessage(Message<MyType> msg) {
  Logger.getAnonymousLogger().info("detected new message on Topic1");
}

I do not have a MessageListener for Topic2. But when I publish a message to Topic2 like so:

hazelcast.getTopic("Topic2").publish(new MyType());

then the MessageListener for Topic1 springs into action.

Is that expected behavior?

Ulrich

Ulrich Mayring

unread,
Aug 29, 2017, 3:21:24 AM8/29/17
to Payara Forum
Answering my own question: probably not.

In trying to come up with a self-contained test case I couldn't reproduce the behavior. So it's likely a problem in the larger system.

Ulrich
Reply all
Reply to author
Forward
0 new messages