Inconsistent headers transport (SQS specific issue?)
See original GitHub issueIs this a bug report?
YES.
Can you also reproduce the problem with the latest version?
YES.
Steps to Reproduce
- Create a typical message customer throwing exception.
- Add
.UseScheduledRedelivery()
filter. - Send a message. It should fail several times and then be moved on the error queue.
Expected Behavior
MT adds a tone of useful headers to the message, all starting with the prefix MT-*
. They should all appear in message’s payload Headers
property as well as in SQS’s “message attributes” unless this newly added AllowTransportHeader
filter states otherwise.
Actual Behavior
Actual message on the queue has some headers only in message body and some only in message attributes:
Payload:
{
"messageId": "eb800000-857f-0205-2274-08d7822ceb48",
"conversationId": "eb800000-857f-0205-3ea1-08d7822ce6fd",
"sourceAddress": "amazonsqs://eu-central-1/my-tmp?durable=false&autodelete=true",
"destinationAddress": "amazonsqs://eu-central-1/dev-krzlab-plgrd-rec",
"messageType": [
"urn:message:WebApp:MyMsg"
],
"message": {
"payload": "throw"
},
"sentTime": "2019-12-16T13:36:13.3759604Z",
"headers": {
"MT-Scheduling-DeliveredAddress": "amazonsqs://eu-central-1/dev-krzlab-plgrd-rec",
"MT-Redelivery-Count": 3
},
"host": {
...
}
}
Message Attributes:
Content-Type: application/vnd.masstransit+json
MT-Fault-Message: EXCEPTION MESSAGE
MT-Reason: fault
Reproducible Demo
c.AddBus(provider => Bus.Factory.CreateUsingAmazonSqs(bfc =>
{
bfc.UseAmazonSqsMessageScheduler();
bfc.Host("eu-central-1", hc =>
{
hc.AccessKey("...");
hc.SecretKey("...");
});
bfc.ReceiveEndpoint("dev-krzlab-plgrd-rec", rec =>
{
rec.UseScheduledRedelivery(r => r.Interval(3, TimeSpan.FromSeconds(2)));
rec.UseInMemoryOutbox();
rec.Consumer<MyMsgConsumer>(provider);
});
}));
public class MyMsgConsumer : IConsumer<MyMsg>
{
public async Task Consume(ConsumeContext<MyMsg> context)
{
throw new Exception("EXCEPTION MESSAGE");
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Working with Amazon SQS messages
Avoiding inconsistent message processing Because Amazon SQS is a distributed system, it is possible for a consumer to not receive a message even...
Read more >ReceiveMessage - Amazon Simple Queue Service
Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support. For more information ...
Read more >Amazon SQS - FIFO Queue message request, inconsistent ...
I have a FIFO SQS queue, with visibility time of 30 seconds. The requirement is to read messages as Quickly as possible and...
Read more >Understand and troubleshoot partial DNS failure
How does DNS work, and how do I troubleshoot partial or intermittent DNS failures?
Read more >ServiceControl Transport Adapter
If the header exists, ServiceControl sends the message to the queue from that header instead of the ultimate destination. The adapter then picks ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can’t find anything else at the moment. 😃
Is there anything else to do on this one?