Skip to content

Conversation

@nyagamunene
Copy link
Contributor

@nyagamunene nyagamunene commented Aug 20, 2025

What type of PR is this?

What does this do?

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Did you document any new/modified feature?

Notes

@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 37.28814% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.41%. Comparing base (b031dc0) to head (0f6df07).

Files with missing lines Patch % Lines
pkg/messaging/nats/pubsub.go 38.63% 26 Missing and 1 partial ⚠️
pkg/messaging/nats/options.go 33.33% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3074       +/-   ##
===========================================
+ Coverage   35.47%   47.41%   +11.93%     
===========================================
  Files         319       52      -267     
  Lines       48061     3109    -44952     
===========================================
- Hits        17052     1474    -15578     
+ Misses      30154     1538    -28616     
+ Partials      855       97      -758     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nyagamunene nyagamunene marked this pull request as ready for review August 21, 2025 08:01
@nyagamunene nyagamunene requested a review from a team as a code owner August 21, 2025 08:01
Comment on lines 68 to 72
slowConsumerConfig: &SlowConsumerConfig{
MaxPendingMsgs: defaultMaxPendingMsgs,
MaxPendingBytes: defaultMaxPendingBytes,
EnableDroppedMsgTracking: defaultEnableDroppedMsgTracking,
EnableSlowConsumerDetection: defaultEnableSlowConsumerDetection,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this to the jsStreamConfig?

Comment on lines 290 to 296
// checkConsumerLag checks the consumer lag and logs warnings if thresholds are exceeded.
// This provides additional slow consumer detection for JetStream consumers.
func (ps *pubsub) checkConsumerLag(ctx context.Context, consumerName string) {
if ps.slowConsumerConfig == nil || !ps.slowConsumerConfig.EnableSlowConsumerDetection {
return
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed at all? Isn't natsErrorHandler going to handle these scenarios anyway?

@arvindh123 arvindh123 moved this to 🚧 In Progress in SuperMQ Aug 25, 2025
@dborovcanin dborovcanin force-pushed the add_NATS_throttling branch 2 times, most recently from a8a732b to b79a933 Compare August 25, 2025 14:52
@arvindh123 arvindh123 changed the title NOISSUE - Add NATs throttling in messaging SMQ-3097 - Add NATs throttling in messaging Aug 27, 2025
@arvindh123 arvindh123 removed this from SuperMQ Aug 27, 2025
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
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.

Add NATs throttling in messaging

2 participants