php - RabbitMQ reject message when processing stops with error -


i using symfony , rabbitmq bundle application , encountered following issue: when consumer service throws uncaught exception/error (eg: out of memory), message republished , consumed again , again until gets either reject or ack signal. want change behavior message instead discarded if uncaught exception/error occurs first time message consumed.

is possible and, if so, how? thanks!

yes, have ack message. can either setting auto-ack flag true (depends on language/api/library using) or ack message manually/explicitly. it's normal ack message cannot processed because otherwise said message republished , consumed again , again.

if want can set requeue false. don't use php dealing rabbitmq don't know api equivalent, where/how nack implemented - in case (not requeing is) may idea configure dead letter exchange (quote link):

messages queue can 'dead-lettered'; is, republished exchange when of following events occur:

the message rejected (basic.reject or basic.nack) requeue=false,
...


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -