Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem causing message Block the processing of good messages #271

Open
neildsouth opened this issue Dec 21, 2023 · 0 comments
Open

problem causing message Block the processing of good messages #271

neildsouth opened this issue Dec 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@neildsouth
Copy link
Collaborator

neildsouth commented Dec 21, 2023

Description

if a message causes a RequeueWithDelay() to be called, with the defaults this delay the NAK for 30 seconds, because the channel is setup like so

_channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false);

this blocks the delivery of another message until the first one is cleared, meaning all processing will stop for potentially several minutes.

There are a few potential solutions that occur to me ATM.

1/ have the prefetch count a config item, but depending on the c# rabbitMq SDK this will need to be tested to ensure it doesnt introduce threading issues.

2/ use the newish plugin for rabbit that allow exchanges to have a message delivery delay, this is set in the message header, this would involve acking the message before a resend with the header set for delay, + setting the retry/failed header count. again this would need testing

3/ like the above you could just ack the message and then resend after a Task.Delay() setting the right message header for the retry/failed count. <--- this doesn't work, Ive tried changing the message header but x-delivery-count isnt use by rabbitMq for the tracking.

Steps to reproduce

publish a message that causes a RequeueWithDelay() the publish one that will not. the second is not delivered until the first is DeadLettered.

Expected behavior

The second should be picked up immediately and processed before the first is on its second round.

Actual behavior

A potential large delay in processing the good message.

@neildsouth neildsouth added the bug Something isn't working label Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant