#739·nsq

nsqd: support length 0 messages

Author: twmbCreated Apr 15, 2016Updated Dec 27, 2023
Labelsquestionrequestchore

Currently, length 0 messages are rejected in doPUB for the http protocol and PUB in protocol_v2.

nsqd's diskQueue reads/writes enforce only the message header size (not requiring body). Also, the go-nsq api allows NewMessage to be called with an empty body, and DecodeMessage would make sense to also support a length 0 body to allow for idempotence between the two funcs.

A length 0 message would allow signals to be passed through an nsq system.