Skip to content

feat: Add new ProcessInlineWhileDraining option for the InlineReceiver#2347

Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom
simplisafe-oss:process-while-draining-inline
Mar 25, 2026
Merged

feat: Add new ProcessInlineWhileDraining option for the InlineReceiver#2347
jeremydmiller merged 1 commit intoJasperFx:mainfrom
simplisafe-oss:process-while-draining-inline

Conversation

@benjamin-alexander-simplisafe
Copy link
Copy Markdown
Contributor

Hi again. This is a follow up to #2322. When I made that PR I misunderstood Defer as putting messages back to the front of the queue (though in hindsight putting it at the back makes more sense in most cases). Putting it at the back can lead to outliers in processing time (especially when put behind thousands of messages, or if the pod which picks up the message a second time starts draining itself), so I've added this option to attempt processing during the drain instead of deferring back to the queue.

It's an option instead of the default because I'm not sure if it's reasonable to do this for existing consumers, though a properly architected inline handler should handle it fine. The other alternative I thought of was the ability to defer to the front of the queue (eg. set sqs visibility timeout to 0), but that would be a much bigger changeset for each receiver type.

When enabled, attempts processing messages already received instead of
deferring them once the drain is started. This allows avoiding latency
outliers from deferring messages behind ones received after it.
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.

2 participants