[zeromq-dev] PUB-SUB filtering question
gonzalo diethelm
gdiethelm at dcv.cl
Mon Aug 16 16:15:26 CEST 2010
> > 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.
The thing here is that a Java String CAN have a binary zero embedded
into it (as far as I understand), although it might not be the best way
to go about it.
> > 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.
I don't think I have dealt with binary strings in Java before, so I am
not sure what is the right(est) solution here. I will be happy to
accommodate the best suggestions that come up in the forum.
--
Gonzalo Diethelm
More information about the zeromq-dev
mailing list