Hazelcast client Subscriber Issue

81 views
Skip to first unread message

Rishav Shandilya

unread,
Sep 1, 2022, 11:02:16 AM9/1/22
to Hazelcast
Hi Hazelcast Team,

We are running one node hazelcast server in one container & other container has hazelcast java client app running.

Now, client is able to connect to hazelcast cluster and play around with data but when it comes to pub/sub, it's not working.

Both pub & sub threads are in same hz java client app but published data is not being received by subscriber.

We have tried with both iTopic and iReliableTopic.

Could you please let me know what could the possible issue?

Rishav Shandilya

unread,
Sep 1, 2022, 11:03:20 AM9/1/22
to Hazelcast
PS: We have 2 different docker containers running on same machine.

Rishav Shandilya

unread,
Sep 3, 2022, 6:41:43 AM9/3/22
to Hazelcast
Hi Hazelcast Team,

Any suggestion on this?

We are using Hazelcast v5.1.3 for both client & server

Josef Cacek

unread,
Sep 7, 2022, 12:06:40 PM9/7/22
to haze...@googlegroups.com
Hi,
can you share a reproducer?
What if you run a simple client application like the following one?

public static void main(String[] args) {
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.getNetworkConfig().addAddress("172.17.0.2");
    HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);

    ExecutorService ex = Executors.newFixedThreadPool(1);
    ex.submit((Runnable) () -> {
        ITopic<String> t = client.getTopic("topic");
        while (true) {
            t.publish("" + Instant.now());
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (InterruptedException e) {
            }
        }
    });
    ITopic<String> t = client.getTopic("topic");
    t.addMessageListener(msg -> System.out.println(msg.getMessageObject()));
}

Regards,
-- Josef


Confidentiality: This electronic mail and any files transmitted with it may contain information proprietary to Baazi Games Pvt Ltd, or one of its subsidiaries or affiliates, and is intended solely for the use of the individual or entities to which this is addressed. This email and contents shall be maintained in confidence and not disclosed to third parties without the written consent of the sender. If you are not the intended recipient or the person responsible for delivering the electronic mail to the intended recipient, be advised that you have received this electronic mail by error and that any use, dissemination, forwarding, printing, or copying of this electronic mail or contents is strictly prohibited. If you have received this electronic mail by error, please immediately notify the sender by return mail.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/d58c4b63-a59d-48ae-81ca-7481f36f38dfn%40googlegroups.com.

This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast

Neil Stevenson

unread,
Sep 12, 2022, 6:05:25 AM9/12/22
to Hazelcast
Reply all
Reply to author
Forward
0 new messages