nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16.01k stars 1.41k forks source link

Do not require "seq" field on DIRECT GET with "max_bytes" supplied #6026

Open scottf opened 1 month ago

scottf commented 1 month ago

Observed behavior

A direct message request with max_bytes but no seq (starting sequence) fails with status message "408 Empty Request" instead of returning messages.

Proposed change

Default the seq to 1

Server version

Server v2.11.0-dev

Steps to reproduce

Create a new stream and publish 5 messages with payloads of 100 bytes. Post a DIRECT.GET with {"batch":5,"max_bytes":150} and one with {"batch":5,"max_bytes":150,"seq":1}