dudleycarr / nsqjs

NodeJS client library for NSQ
https://nsqjs.com
MIT License
558 stars 75 forks source link

Is there any limit on writer bulk publish message counts? #282

Closed apmcodes closed 5 years ago

apmcodes commented 5 years ago

While using the bulk/ multiple messages publish, is there any limit on messages count or byte size of the messages array?

gbhrdt commented 5 years ago

I just ran into this, seems to be 5242880 bytes per publish:

E_BAD_BODY MPUB body too big 5629025 > 5242880
dudleycarr commented 5 years ago

There is both a limit on the number of messages and the message size. Here is the protocol definition: https://nsq.io/clients/tcp_protocol_spec.html#mpub

It looks like realistically, there isn't a limit on the number of message since it's 2^32 - 1. However, the error that @gbhrdt has run into is the maximum message size which is set as a configurable option for nsqd. See max-body-size in: https://nsq.io/components/nsqd.html