Skip to content

Order of operations in message acknowledgement / consumer failure #349

@elazar

Description

@elazar

In Consumer->invoke(), if the routed callback throws an error or exception, the subsequent message acknowledgement never occurs.

When using FailureSubscriber, the result of this is that the original message both remains in the original queue and is added to the designated failure queue.

Because the original message never leaves the original queue, the consumer continues attempting to process it, likely encountering the same issue that caused the original error or exception to be thrown, and causing duplicate messages to be added to the failure queue in the process. This continues ad nauseam, filling up the failed queue.

This doesn't seem like it should be intended behavior. If anything, I would think that message acknowledgement should happen first. That way, the message will still end up in the designated failure queue if FailureSubscriber is in use, but the consumer won't continue trying to process it.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions