softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.46k stars 193 forks source link

DeadLetterQueueSourceArn missing while receiving message from DLQ #921

Closed jgchoppe closed 3 months ago

jgchoppe commented 7 months ago

Hey!

I'm currently using your awesome tool to test AWS SQS queues locally. The goal of my architecture would be to have SQS queues with a DeadLetters Queue. I'm able to pull messages from the DLQ, However DeadLetterQueueSourceArn is missing from the attributes.

Example with AWS SQS:

{
    "Messages": [
        {
            "MessageId": "************************************",
            "ReceiptHandle": "*****",
            "MD5OfBody": "*****",
            "Body": "example",
            "Attributes": {
                "SenderId": "*********************",
                "ApproximateFirstReceiveTimestamp": "1701176294398",
                "ApproximateReceiveCount": "8",
                "SentTimestamp": "1701176278493",
                "SequenceNumber": "18882245240547823616",
                "MessageDeduplicationId": "************************************",
                "MessageGroupId": "test",
                "DeadLetterQueueSourceArn": "arn:aws:sqs:us-west-2:*****:example.fifo"
            }
        }
    ]
}

Example with ElasticMQ:

{
    "Messages": [
        {
            "MessageId": "************************************",
            "ReceiptHandle": "************************************#************************************",
            "MD5OfBody": "e4b3b7558956e56fcb6b5397bdc6523d",
            "Body": "example",
            "Attributes": {
                "ApproximateFirstReceiveTimestamp": "1701176081533",
                "SentTimestamp": "1701175918154",
                "MessageDeduplicationId": "************************************",
                "SenderId": "*********",
                "ApproximateReceiveCount": "6",
                "MessageGroupId": "test",
                "SequenceNumber": "0"
            }
        }
    ]
}

It would be great if this attribute could be added when the message is moved to the DLQ.

micossow commented 3 months ago

Fixed in v1.5.8 Thanks for reporting the issue!