How to retract a message in RabbitMQ?

后端 未结 4 1325
旧巷少年郎
旧巷少年郎 2021-02-04 05:26

I\'ve got something like a job queue over RabbitMQ and, upon a request to cancel a job, I\'d like to retract the tasks that have not yet started processing (their messages have

4条回答
  •  别跟我提以往
    2021-02-04 06:07

    At least two ways to achieve your target:

    • basic.reject will requeue message if requeue=true is set (otherwise it will reject message).
      (supported since RabbitMQ 2.0.0; see http://www.rabbitmq.com/blog/2010/08/03/well-ill-let-you-go-basicreject-in-rabbitmq/).

    • basic.recover will ask broker to redeliver unacked messages on channel.

提交回复
热议问题