Closed AnudeepGarge closed 4 years ago
See https://github.com/zeromq/netmq/issues/482 this explains why the first messages are lost. The subscriber must be reconnected before published data will be recieved. Have a look at for instance http://zguide.zeromq.org/php:chapter5#Last-Value-Caching Please reopen if you disagree.
Environment
Expected behaviour
I have a pub-sub pattern implemented. In one of my scenario the pub disposes and will be recreated after a while (while subscribers remain intact). The first message sent by the publisher after creating and stating it is lost, but if I give a delay of around 1 sec the message is received in the subscriber.
Actual behaviour
The first message must not be lost, also a delay looks unnecessary.
Steps to reproduce the behaviour
Create a pub-sub pattern in 2 different processes (same process will do the job as well). Send a message from pub. Dispose the pub and create it back again binding to the same port. Try sending the message immediately, The first message will be lost.