jeromq
jeromq copied to clipboard
Event wire format is different between jeromq and libzmq
In the C code, sending a version 1 event is done using the following code:
const uint16_t event = static_cast<uint16_t> (event_);
const uint32_t value = static_cast<uint32_t> (values_[0]);
...
memcpy (data + 0, &event, sizeof (event));
memcpy (data + sizeof (event), &value, sizeof (value));
zmq_msg_send (&msg, _monitor_socket, ZMQ_SNDMORE);
...
memcpy (zmq_msg_data (&msg), endpoint_uri.c_str (),
endpoint_uri.size ());
zmq_msg_send (&msg, _monitor_socket, 0);
In jeromq, it's:
buffer.putInt(event);
buffer.put((byte) addr.length());
buffer.put(addr.getBytes(CHARSET));
buffer.put((byte) flag);
if (flag == VALUE_INTEGER) {
buffer.putInt((Integer) arg);
}
So it's not possible to forward Jeromq event to a native ZMQ application. Is that a problem ?
It hasn't been a problem so far but if we fix it, we could potentially break some peoples code. We'll definitely need to bump the major version next release