Consumers created with amqp_consume() will now acknowledge messages only after the callback has run. Moreover, when a callback fails the message in question will be nacked instead. The new requeue_on_error parameter controls whether messages should be redelivered when callbacks error; by default it is FALSE, in line with current behaviour.
For complete control over when and how messages are nacked, one can use the new amqp_nack() function, which works like stop() inside a message handler. This allows for complex acknowledgement behaviour for a consumer, which might e.g. be used in combination with a dead letter exchange.
Follows discussion in #2.
Changes:
Consumers created with
amqp_consume()
will now acknowledge messages only after the callback has run. Moreover, when a callback fails the message in question will be nacked instead. The newrequeue_on_error
parameter controls whether messages should be redelivered when callbacks error; by default it isFALSE
, in line with current behaviour.For complete control over when and how messages are nacked, one can use the new
amqp_nack()
function, which works likestop()
inside a message handler. This allows for complex acknowledgement behaviour for a consumer, which might e.g. be used in combination with a dead letter exchange.Includes tests and documentation updates.