-
Notifications
You must be signed in to change notification settings - Fork 650
Issue with Message Ordering in ZeroMQ PUSH-PULL Using send_multipart #2074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you share an example code that reproduces the problem? Libzmq should guarantee that multipart messages are delivered in order in tact, so this should only happen from your description if a recv call is happening but the partial message is not being retrieved. |
@minrk , Below is the code in sender and receiver side . The sender processes some calculation and sends the response as below : Receiver side :
|
A more complete example that can reproduce the problem would definitely help. If there are e.g. any threads or other interactions with the sockets, or error handling, that will be relevant. You can check socket.rvcmore before calling recv_multipart. If that is true, it means that a message has already been partially received and you are going to start receiving a message in the middle. Generally this would mean an earlier call to recv, or an interrupted call to recv_multipart. |
I see the same issue with two publishers and one subscriber. Publishers uses c++ api. And subscriber is using python api. |
Issue with Message Ordering in ZeroMQ PUSH-PULL Using send_multipart
Context:
I am currently working on a multi-threaded module where multiple PUSH sockets send messages to a single PULL socket using ZeroMQ. The messages are sent using the send_multipart method in the following format:
send_socket.send_multipart([msg1, msg2])
On the receiver side, I am using:
x = receive_socket.recv_multipart() .
I expect x[0] to always contain the JSON data (msg1), and x[1] to contain the JPEG bytes (msg2). However, in some cases, I am receiving the JPEG bytes as x[0], causing message misalignment.
Current Setup:
Questions:
Any insights or suggestions would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: