zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.45k stars 2.34k forks source link

ZMQ subscriber doesn't receive message first time occasionally. #4656

Closed Neeraj0019 closed 4 months ago

Neeraj0019 commented 4 months ago

Please use this template for reporting suspected bugs or requests for help.

Issue description

We have a ZMQ PUB SUB socket implemented as part of 2 different application as soon as subscriber service starts it subscribes to a particular string format. Sometimes we see even when publisher has published the message subscriber didn't receive it and it happens only for the first message occasionally the same message after some time is received properly.

Environment

Minimal test code / Steps to reproduce the issue

What's the actual result? (include assertion message & call stack if applicable)

What's the expected result?

bluca commented 4 months ago

This is the late joiner problem https://zguide.zeromq.org/docs/chapter5/

Neeraj0019 commented 4 months ago

This is the late joiner problem https://zguide.zeromq.org/docs/chapter5/ @bluca Hi Bluca, Thanks for the reply but in my case the subscriber had not joined late it already in the polling state for around 10-15 sec still when publisher published the message, subscriber is not getting it but the very next message (same one with retry after 5 sec) it is able to get it. And this happens occasionally.

Br, Neeraj