Skip to content

[ADDED] Service API: WithEndpointPendingLimits option#1899

Merged
piotrpio merged 1 commit intomainfrom
micro-set-pending-limits
Jul 9, 2025
Merged

[ADDED] Service API: WithEndpointPendingLimits option#1899
piotrpio merged 1 commit intomainfrom
micro-set-pending-limits

Conversation

@piotrpio
Copy link
Copy Markdown
Collaborator

@piotrpio piotrpio commented Jul 8, 2025

Adds ability to configure pending message/byte limits on service endpoints to handle slow consumers gracefully.

  • Add WithEndpointPendingLimits() option for endpoint configuration
  • Support message count and/or byte limits (-1 for no limit)
  • Enhanced NATSError with error wrapping support for proper error chains

Adds ability to configure pending message/byte limits on service endpoints
to handle slow consumers gracefully.

* Add WithEndpointPendingLimits() option for endpoint configuration
* Support message count and/or byte limits (-1 for no limit)
* Enhanced NATSError with error wrapping support for proper error chains

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio requested a review from Jarema July 8, 2025 14:14
@piotrpio piotrpio marked this pull request as ready for review July 8, 2025 14:14

err = srv.AddEndpoint("test", handler,
micro.WithEndpointSubject("test.pending"),
micro.WithEndpointPendingLimits(msgLimit, bytesLimit))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!

Copy link
Copy Markdown
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@piotrpio piotrpio merged commit 62bc628 into main Jul 9, 2025
7 checks passed
@piotrpio piotrpio deleted the micro-set-pending-limits branch July 9, 2025 10:47
@piotrpio piotrpio mentioned this pull request Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants