You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I would like to be able to choose the Nack method used depending on the message processing.
Example
// file: watermill/message.gotypeMessagestrut {}
func (m*Message) Nack(methodNackMethod) {
m.nack<-method
}
// file: watermill-amqp/subscriber.go// Here we can handle the method// file: handler.gofunchandler(msg*message.Message) error {
// ...msg.Nack(message.NackRequeue)
msg.Nack(message.NackDiscard)
msg.Nack(message.NackDelay(5*time.Minute))
}
With this example implementation, nack will return a method and the subscriber can:
either handle it and support the method
default to it's default nack method if it doesn't support discard or delay for example
Of course this is just an example, but with method like this, we should be able to override the nack method used.
This can be used in subscriber like:
amqp with amqp.NackDiscard and amqp.NackRequeue
nats with nats.Term(), nats.InProgress(), nats.Nak() and nats.NakWithDelay()
Middleware example
To make this easier to use, we can make use of it via middleware. For example, an handler can return an error, and the middleware will choose the best method for the ack.
Hello, I would like to be able to choose the Nack method used depending on the message processing.
Example
With this example implementation, nack will return a method and the subscriber can:
Of course this is just an example, but with method like this, we should be able to override the nack method used.
This can be used in subscriber like:
amqp.NackDiscard
andamqp.NackRequeue
nats.Term()
,nats.InProgress()
,nats.Nak()
andnats.NakWithDelay()
Middleware example
To make this easier to use, we can make use of it via middleware. For example, an handler can return an error, and the middleware will choose the best method for the ack.
The text was updated successfully, but these errors were encountered: