user3262424
user3262424

Reputation: 7479

ZeroMQ Message Size Length Limit?

Suppose that several machines are interacting together using python's zeroMQ client.

These messages are naturally formatted as strings.

Is there a limit to the length of a message (string)?

Upvotes: 23

Views: 22701

Answers (4)

meawoppl
meawoppl

Reputation: 2802

Some socket types support up to 2^64, but some less than 2^31.

You should build a protocol that keeps chunks below that size anyway, but this is the real answer.

https://github.com/zeromq/libzmq/issues/1332

Upvotes: 4

Rob Agar
Rob Agar

Reputation: 12447

There is the socket option ZMQ_MAXMSGSIZE which causes a peer sending an oversized message to be disconnected, but the default is "no limit".

Upvotes: 5

cloudcell
cloudcell

Reputation: 497

No limit

As for small size messages transmitted within zmq_msg_t structures, their limit is 29 bytes (for zmq version 3.2.2)

"max_vsm_size = 29," quoted from https://github.com/zeromq/libzmq/blob/master/src/msg.hpp

Upvotes: 2

kwo
kwo

Reputation: 1884

There is no limit to the size of messages being sent however small messages are handled differently than large messages (see here).

The max size of a small messages is defined in the source code at 30 bytes (see here, look for ZMQ_MAX_VSM_SIZE).

Upvotes: 21

Related Questions