question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent headers transport (SQS specific issue?)

See original GitHub issue

Is this a bug report?

YES.

Can you also reproduce the problem with the latest version?

YES.

Steps to Reproduce

  1. Create a typical message customer throwing exception.
  2. Add .UseScheduledRedelivery() filter.
  3. 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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Crozincommented, Jan 31, 2020

Can’t find anything else at the moment. 😃

0reactions
phatboygcommented, Jan 31, 2020

Is there anything else to do on this one?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found