[zeromq-dev] Can a broker explicitly deny certain subscriptions to certain clients?

David Jelenc david.jelenc at fri.uni-lj.si
Mon Aug 31 18:46:00 CEST 2015


many thanks for your advice. If I may ask -- would it be possible to 
shed a bit more thoughts on the matter, since I'm not sure that I fully 
understand your take.

Are you suggesting that I replace PUB-XSUB and XPUB-SUB combos with 
ROUTER-DEALER or that I bridge (inside broker) XSUB to DEALER and ROUTER 
to XPUB?

In the second case, I don't see how this would help. Since I can already 
see subscription messages, I can already simply ignore (not forward from 
XPUB to XSUB) unauthorized subscription messages.

However this achieves half the job: it still subscribes an unauthorized 
client to the broker, but it does not forward subscriptions to other 

(But if at some later time, another client--that is authorized to 
subscribe to this topic--also subscribes, both subscribers will receive 

Best, David

On 31. 08. 2015 18:08, Pieter Hintjens wrote:
> You can do this using a dealer to router pattern and your own routing
> logic in the broker. Malamute provides a lot of this, though does not
> yet do per access control to topics.
> Pieter
> On 31 Aug 2015 17:42, "David Jelenc" <david.jelenc at fri.uni-lj.si
> <mailto:david.jelenc at fri.uni-lj.si>> wrote:
>     Hi,
>     I'm wondering if there is a way to explicitly deny a certain client from
>     subscribing to a certain topic.
>     I have a broker set up, where some clients publish and other subscribe.
>        client                              client
>     PUBLISHER -------- BROKER -------- SUBSCRIBER
>     PUB --- (XSUB | broker  logic | XPUB) --- SUB
>     Since I'm using a XPUB socket on the broker, I can see all subscription
>     and subscription cancellation messages. However, once these messages
>     reach broker, the client is already subscribed.
>     Is there any way on how I can prevent a client from subscribing to
>     certain topics (while allowing the same client to subscribe to some
>     other) and enforce this on the broker side (in the broker logic)?
>     Any help would be greatly appreciated.
>     Best,
>     David

More information about the zeromq-dev mailing list