Skip to content

Conversation

l4mby
Copy link
Contributor

@l4mby l4mby commented Jul 9, 2025

This pr adds a DeliveryContext to the consumer message handler.
Through this context it is possible to accept, discard or requeue a message, for example:

const consumer = await connection.createConsumer({
      queue: { name: "test-queue" },
      messageHandler: (context, message) => {
        context.accept()
        // or ...
        context.discard()
        // or ...
        context.requeue()
      },
})

@l4mby l4mby linked an issue Jul 9, 2025 that may be closed by this pull request
apietroni51
apietroni51 previously approved these changes Jul 9, 2025
@l4mby l4mby merged commit d4715e2 into main Jul 9, 2025
4 checks passed
@apietroni51 apietroni51 deleted the 44-as-a-library-user-i-want-to-decide-if-accepting-the-message-or-not branch July 17, 2025 09:14
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.

As a library user I want to decide if accepting the message or not

2 participants