nats-io / nats-architecture-and-design

Architecture and Design Docs
Apache License 2.0
178 stars 20 forks source link

StreamConfig adds `discard_new_per_subject: boolean` on servers 2.9.2 and better #160

Open aricart opened 1 year ago

aricart commented 1 year ago

Overview

Stream configuration now adds the boolean property discard_new_per_subject. This new option works in conjunction of the discard and it is not valid (rejected by the server) if the discard policy is not new.

The new option will prevent a message from being added to a stream if the max_msgs_per_subject limit for the subject has been reached, returning a {"error":{"code":503,"err_code":10077,"description":"maximum messages per subject exceeded"}, "stream":"KV_A","seq":0}

Clients and Tools

Other Tasks

Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.