Back pressure / requeuing limit #3942
-
Hey Guys, @RabbitListener(
id = "formReceiver",
queues = INCOMING_QUEUE_SPEL,
errorHandler = "formRabbitErrorHandler")
public void receive(Message original, @Valid Form form) {
logger.info("Received message: {}", original);
try {
somethingService.process(form);
} catch (RetrySendMailException ex) {
throw new ImmediateRequeueAmqpException(ex);
} catch (Exception ex) {
throw new AmqpRejectAndDontRequeueException(ex);
}
}
public class FormRabbitErrorHandler implements RabbitListenerErrorHandler {
private final Logger logger;
@Autowired
public FormRabbitErrorHandler(Logger logger) {
this.logger = logger;
}
@Override
public Object handleError(
Message amqpMessage,
org.springframework.messaging.Message<?> message,
ListenerExecutionFailedException exception) {
logger.warn("Execution of Rabbit message listener failed.", exception);
throw exception;
}
} If an error is occurred, message will be requeued, and it's fine. But a lot of messages will be logged which increases the cost of operation.
So to recap, are there any way to reduce/limit the throughput on RabbitMQ side? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is not. |
Beta Was this translation helpful? Give feedback.
There is not.