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

fix: Reject poisonnous message and requeue waiting, failed, running and postponed in all queue implementation #728

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Adaptors/PubSub/src/QueueMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ await autoExtendAckDeadline_.Stop()
case QueueMessageStatus.Failed:
case QueueMessageStatus.Running:
case QueueMessageStatus.Postponed:
case QueueMessageStatus.Poisonous:
await subscriberServiceApiClient_.ModifyAckDeadlineAsync(subscriptionName_,
new[]
{
Expand All @@ -79,6 +78,7 @@ await subscriberServiceApiClient_.ModifyAckDeadlineAsync(subscriptionName_,
break;
case QueueMessageStatus.Cancelled:
case QueueMessageStatus.Processed:
case QueueMessageStatus.Poisonous:
await subscriberServiceApiClient_.AcknowledgeAsync(subscriptionName_,
new[]
{
Expand Down
19 changes: 10 additions & 9 deletions Adaptors/RabbitMQ/src/QueueMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,29 @@ public ValueTask DisposeAsync()
switch (Status)
{
case QueueMessageStatus.Postponed:
case QueueMessageStatus.Failed:
case QueueMessageStatus.Running:
case QueueMessageStatus.Waiting:
/* Negative acknowledging this message will send it
to the retry exchange, see PullQueueStorage.cs */
channel_.BasicNack(basicGetResult_.DeliveryTag,
false,
true);
break;
case QueueMessageStatus.Failed:

case QueueMessageStatus.Running:

case QueueMessageStatus.Cancelled:

case QueueMessageStatus.Waiting:

case QueueMessageStatus.Processed:

case QueueMessageStatus.Poisonous:
/* Failed, Processed and Poisonous messages are
* acknowledged so they are not send to Retry exchange */
channel_.BasicAck(basicGetResult_.DeliveryTag,
false);
break;

case QueueMessageStatus.Poisonous:
channel_.BasicNack(basicGetResult_.DeliveryTag,
false,
false);
break;

default:
throw new ArgumentOutOfRangeException(nameof(Status),
Status,
Expand Down