I have a lambda function which is implemented with Chalice and I am trying to process SQS messages with it.
The code is implemented based on this documentation: https://aws.github.io/chalice/api.html#Chalice.on_sqs_message
app.py
app = Chalice(app_name='payment-service')
@app.on_sqs_message(queue="payment-service-dev.fifo")
def lambda_sqs_message(event):
print("MESAGE QUEUE EVENT ", event)
for record in event:
print("Process Event")
return True
The problem is that I am not receiving any logs from the lambda_sqs_message
when the Lambda Function handler is set to app.app
. However, it works if I set the Lambda Function handler to app.lambda_sqs_message
.
Handler set to app.app
- Queue events not processed
Handler set to app.lambda_sqs_message
- Queue events are processed
I don't think that it makes any sense to have the the Lambda handler set to lambda_sqs_message
because this way the on_sqs_message
is useless.
Did I misunderstood the configuration requirements and the Lambda Function handler needs to be set to the SQS message handler function, instead of the Chalice instance?