Skip to content

v4.1.0

  • v4.1.0
  • 1158631
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
  • Choose a tag to compare

  • v4.1.0
  • 1158631
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@cody-greene cody-greene tagged this 27 Jun 04:03
A ConsumerHandler can return a status code for precise control of ack/nack behavior. An enum type is provided for convenience, but it's not necessary.

```typescript
import {ConsumerStatus} from 'rabbitmq-client'

const sub = rabbit.createConsumer({
  queue: 'my-queue',
  requeue: false // behavior with exceptions
}, async (msg) => {
  // optionally return a status code
  // 0 or undefined - ack
  // 1              - nack(requeue=true)
  // 2              - nack(requeue=false)
  return ConsumerStatus.REQUEUE // 1
})
```
Assets 2
Loading