RabbitMQ Event Source Basic nack and Reject

1

Once we receive message from the RabbitMQ Amazon MQ Event Source to the Lambda. How can I reject message and how to restrict the maxRetry in case of exception in the lambda.

2 Answers
0

Please see the Amazon MQ for Rabbit MQ and Lambda documentation here - https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html

If by rejecting a message, you mean you don't want to process it, then all you need to do is consume the message in your lambda function and not process it. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire. (see the documentation link above). Your lambda function will need to consider this as part of the consumer processing design.

AWS
answered 2 years ago
  • In case of rejecting message is fine I won't process the message.

    But in case when I am using the dead letter exchange and dead letter key for the queue. I have to acknowledge negative for the message so that rabbit mq remove the message from the current queue and forward the message to the dead letter exchange. Since I am not able to negative acknowledge the message retry mechanism is not possible.

    How can I resolve this issue?

0

We are facing same issue, seems it’s impossible to do that with as is Amazon mq implementation for rabbitmq broker :(

Max
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions