Skip to content
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

PUB/SUB filtering on publisher side #3611

Closed
vsmelov opened this issue Aug 7, 2019 · 2 comments
Closed

PUB/SUB filtering on publisher side #3611

vsmelov opened this issue Aug 7, 2019 · 2 comments

Comments

@vsmelov
Copy link

vsmelov commented Aug 7, 2019

How does per-topic filtering works?

When I use PUB/SUB and subscribe for some specific topics, does filtering happen on PUB side or on SUB side?
I cannot find any definite answer in ZMQ docs.

Here they say that it's done on SUB (what is inefficient)

https://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/pubsub.html

The current version of zmq supports filtering of messages based on topics at subscriber side. This is usually set via socketoption.

In the current versions of ØMQ, filtering happens at the subscriber side, not the publisher side.

But here they say that it's done on PUB side.

https://stackoverflow.com/questions/26533016/pyzmq-how-do-you-filter-at-publisher-side

#2068

How does it really work?
Can you add more explanations to ZMQ Guide?

Thank you :-)

@somdoron
Copy link
Member

somdoron commented Aug 7, 2019

Both actually, most of the time. Subscriber is always filtering, publisher filter for most transports, but not all (e.g pgm filtering is only on subscriber side).

Subscriber filtering is done for two reasons:

  • Not all transports support publisher-side filtering.
  • Immediate unsubscribe - you might receive a message matching a subscription you just unsubscribed because the publisher didn't process the unsubscribe command yet.

@bluca
Copy link
Member

bluca commented Sep 2, 2019

Question answered, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants