Open komape opened 2 years ago
Bit late, but calling socket#subscribe() on an XSUB socket doesn't work indeed. We've fixed it like:
for (String sub : subscriptions) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bos.writeBytes(new byte[]{0x01});
bos.writeBytes(sub.getBytes(StandardCharsets.UTF_8));
socket.send(bos.toByteArray());
}
Btw, we're using socket#connect() instead of socket#bind() on an XSUB, but I'm not sure about the reasoning behind that anymore.
My system has a broker with two sockets, one xPub and one xSub. When I try to subscribe the xSub socket to all topics I get an
IllegalArgumentException
with the error messageUnknown Option 6
. It looks like that the subscription command is internally mapped to the number 6. But there is no switch case option that handles the number 6.What's the recommended way to handle this?