[zeromq-dev] Subscribing in JAVA api

Martin Sustrik sustrik at 250bpm.com
Fri May 14 07:51:22 CEST 2010


Chris,

>> Nope, you should do it this way:
>> 
>> zmq_setsockopt (s, ZMQ_SUBSCRIBE, "animals.mammals", 15);
>> 
>> Note that the data passed to the socket option do not contain the 
>> terminal zero.
>> 
>> Any message starting with "animals.mammals" will match the
>> subscription.
>>  
> Hi Martin, that's why I said "not" receiving animals.mammals.cats.
> There are cases we'd want to subscribe to an *exact* topic.  ZeroMQ's
> prefix topic matching is similar to AMQ's topic.prefix.# pattern
> matching.  But AMQ by default let you do exact topic match so that
> animals.mammals will only match animals.mammals.

Yes. The delimiting of topics is implicit in AMQP. In 0MQ you are free 
to choose the delimiter yourself.

Martin



More information about the zeromq-dev mailing list