Q:

Is there a way to let XSUB in zeromq to receive any messages

I want XPUB/XSUB because I want to send data from XSUB to XPUB. I successfully send a subscribe message with a filter string from XSUB to XPUB and then receive data from XPUB to XSUB with the filter string as the prefix.
My XSUB client receives nothing if I don't use that filter. If I don't send any subscribe message from XSUB to XPUB, my XSUB client receives nothing too. Is there a way to disable filter at all in zeroMQ for XPUB/XSUB? I just want XSUB to receive everything sent from XPUB.

A:

In short: XSUB socket subscribes to all messages when byte 1 is sent to the socket.
With SUB socket all messages are subscribed by setsockopt with ZMQ_SUBSCRIBE and zero length byte array. XSUB socket subscribes by sending messages to the socket. When message starts with byte 1, the rest of the message is considered to be a subscription. If first byte is 0, then it is a cancellation of previous subscription.
Hope this helps.
Relevant API entries:

ZMQ_SUBSCRIBE 
XSUB

