[zeromq-dev] PUB-SUB filtering question

Martin Sustrik sustrik at 250bpm.com
Mon Aug 16 15:59:52 CEST 2010


Alexey,

> There are some problems with considering the topics byte sequences.
> First, it will still break on byte sequences with 0x00 in the middle
> (like raw UUIDs or something), right?

No. It should not.

> Second, java bindings work with
> Strings not byte arrays at the moment, which might pose problems with
> interoperability.

The original java bindings I've written used byte arrays. If Java 
binding developers have changed it to string and if Java string is 
incapable of holding a binary zero, then it should be reported as bug IMO.

> If pub/sub topics are considered byte sequences, then I think the API
> should change on both sides — setsockopt(ZMQ.SUB, char* topic, int
> topic_length) in C and socket.setSubscribe(byte[] topic) in Java.

The C API looks exactly like that.

As for the Java binding, it depends on whether Java string is 
zero-terminated. One additional problem may be whether Java strings are 
ASCII or unicode.

Martin




More information about the zeromq-dev mailing list