jzmq icon indicating copy to clipboard operation
jzmq copied to clipboard

IPC between Python and Java

Open qeroll opened this issue 1 year ago • 0 comments

Hi,

I am trying to communicate over IPC using a JZMQ subscriber and PyZMQ publisher but messages are received in the JZMQ side. I have checked my publisher using a Python subscriber and did it work.

Any ideas? Is that perhaps not supported?

The JZMQ code:

ZContext context = new ZContext();
Socket subscriber = context.createSocket(SocketType.SUB);
subscriber.connect("ipc://001);
subscriber.subscribe("".getBytes());
byte[] data = subscriber.recv();

The PyZMQ code:

import zmq

ZMQ_SERVER_ADDRESS = "ipc://001"

context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind(ZMQ_SERVER_ADDRESS)
socket.send(b"1234")

qeroll avatar Feb 28 '24 17:02 qeroll