Search code examples
amazon-web-servicesaws-lambdaactivemq-classicamazon-mq

Acknowledging message receipt with Amazon MQ and Lambda functions


I have a Lambda function that's triggered by Amazon MQ running ActiveMQ.

I would like my Lambda function to acknowledge receipt of the message once it has been processed so that ActiveMQ can remove it from the queue or topic.

I can't find any relevant documentation on AWS that tells me how I'm supposed to send that acknowledgement back, or how ActiveMQ will know when a consumer has successfully processed a message.

Any ideas?


Solution

  • If Lambda is using the OpenWire JMS client as noted in their documentation then it must be using one of the acknowledgement modes provided by JMS (i.e. AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE). However, I don't see any indication in the documentation which mode they're using and any way it can be changed. Therefore my guess is that they're using AUTO_ACKNOWLEDGE since that's usually what integration frameworks, etc. use by default. If that's true then there's nothing your Lambda function needs to do. The message will be acknowledged automatically by the OpenWire JMS client.