-
Notifications
You must be signed in to change notification settings - Fork 55
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
No messages getting through XPUB/XSUB proxy #108
Comments
I actually think the bug is in XSUB. |
Actually, it seems to be because there is no subscribe logic in the SUB/XSUB sockets. SUB does keep a map of subscribed topics, but it doesn't actually use it to screen the messages. Instead, that logic is in the PUB thread -- it won't send a message unless the PUB socket is subscribed to it, which is counter to how ZMQ is supposed to work -- you subscribe to topics with SUB/XSUB and the publisher shouldn't have to know or care what you're subscribed to. |
it's probably because I initially wrote this with a heavy inspiration from PRs welcomed. |
I made a fix, but it hadn't finished building before it was time to knock off work for the day, so I'll test it fully on Monday. |
Any update, sir? @stitchinthyme |
Just submitted the PR, which works with my test programs above. P.S. Not a 'sir'. :-) |
@stitchinthyme My bad, lol! thank you! |
I wrote the following small test server, which creates XPUB and XSUB sockets, and a proxy to send all messages received on the XSUB port to the XPUB port:
And a test client which connects to both ports, sends a series of 10 messages to the pub port (which is the server's sub port), and listens for them on the sub port (the server's pub port):
When I run the server in one window and the client in another, the server binds the ports properly and the client seems to be connecting and sending the messages, but the receiver in the client never gets them and never prints anything. I'm expecting to see a series of "Sending message [0-9]" and "Received msg [TEST] [0-9]". I see the "Sending message" prints, but not the "Received" ones.
I'm using Go 1.13 on Ubuntu 18.04.
One more note: I have almost exactly this same code using https://github.com/pebbe/zmq4 (with adjustments for API differences like Bind() vs. Listen(), etc.) and it works fine.
The text was updated successfully, but these errors were encountered: