I am trying to use python with zeroMQ in PUSH / PULL mode, sending messages of size 4 [MB] every few seconds.
For some reason, although it seems that all messages have been sent, ONLY SOME of them seem to have been received by the server. What am I missing here?
Here the code for the client is client.py
import zmq import struct # define a string of size 4[MB] msgToSend = struct.pack('i', 45) * 1000 * 1000 context = zmq.Context() socket = context.socket(zmq.PUSH) socket.connect("tcp:
And here is the code for the server - server.py
import zmq import struct context = zmq.Context() socket = context.socket(zmq.PULL) socket.bind("tcp://127.0.0.1:5000") while True:
What am I missing? How can I guarantee that messages are always sent and not lost?
In case that matters, I use Ubuntu 10.04 32bit, Core Duo with 2 RAM [RAM].
NOTE. . I tried the same example using RabbitMQ and everything works fine - not a single message is lost. I am puzzled since I often hear zeroMQ praise. Why did this fail if RabbitMQ succeeds?
python zeromq
user3262424
source share