[zeromq-dev] Remote client does not receive any messages

Andreas Bauer dabukster at gmail.com
Sat Nov 29 17:22:08 CET 2014


Hi,

it’s one of the standard and basic „can’t receive message" problem questions, but I’m not able to spot the error...

I have implemented a simple client and a server using PUB/SUB in java using jeromq 0.3.2 according to the examples in the wiki.

If I execute both programms locally, the client receives data. If I deploy the same client jar without change on a remote computer and run it, I don't receive any messages. 

The client is always using the ip (not „localhost" as hard coded string) of the server in both cases. Thus no changes here for the remote deployment. 

Firewall should not be an issue either, as the netstat excerpt below shows (Interestingly netstat -a for 0.3.2 shows the below entry, 0.3.4 does not…). The server (for test purpose my Macbook Air) does also not block any outgoing traffic.

Any hints? Somehow I'm not able to spot the error (probably something stupid, but too blind to see…) 

Server.java

ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket publisher = context.socket(ZMQ.PUB);
publisher.bind("tcp://*:5556"); 


Client.java

ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket  subscriber = zmqContext.socket(ZMQ.SUB);
subscriber.connect("tcp://192.168.178.21:5556");
subscriber.subscribe("".getBytes());
Firewall shouldn't be an issue either

netstat -a | grep 5556 

says

tcp        0      1 192.168.178.29:38145    192.168.178.21:5556     SYN_SENT


Finally my iptables config, just in case I made a stupid configuration mistake here.

*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1161:105847]
-A INPUT -i lo -j ACCEPT
-A INPUT -s 192.168.178.0/24 -j ACCEPT
COMMIT

Best regards,

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141129/0d86d9ba/attachment.htm>


More information about the zeromq-dev mailing list