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.

Message Identifier - x-message-id

See original GitHub issue

im using the header x-message-id in a property in my code and its not being reflected in my event header when I publish it.

public class TurnoverData
{
        public Turnover Turnover { get; set; }
        public string AccountIdToBeActivated { get; set; }
}
public class Turnover
{
        [Header("x-message-id")]
        public string TurnoverId { get; set; }
        public string CreationDateTime { get; set; }
        public string PostingDate { get; set; }
}

I check the source code and found that just if the property is called Id or MessageId the lib retrieve the value and put it in the headers

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
1bbertocommented, Jun 5, 2020

I’ve thought about the third option too. I though that maybe there would exist another way to do it without having to create a Behavior, but well, i know that reflection is painfull and it carries other issues with that also. Thanks a lot @BEagle1984 for the quickly replies!

1reaction
BEagle1984commented, Jun 5, 2020

Not out of the box. It involves reflection and I kept the logic as lean as possible. The attributes are also being cached and allowing them in a child object would increase the complexity (considering polymorphism as well).

You got many workarounds tho:

  1. Move the property to the root
  2. Have a calculated property in the root that reflects the value of the child property and decorate that one with the attribute
  3. Write a behavior that sets your header (you don’t need to use reflection, just car to your message type and set the header from the property)
  4. Replace the HeadersWriterProducerBehavior with a custom implementation

I would go with option 1. If that’s not possible 3 is my second choice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Message-ID
Message-ID is a unique identifier for a digital message, most commonly a globally unique identifier used in email and Usenet newsgroups. Message-IDs are ......
Read more >
What Is an Email Message-ID and How Do I Find It?
All emails have a unique fingerprint called a Message-ID. There are different ways of locating this identifier in various email clients.
Read more >
How to find the Message-ID of an email and use it to track ...
Message-ID (also known as Internet message ID or Client ID) is an identifier of emails. It is generated by the sending mail system....
Read more >
Message identifier
Select the "Message identifier" choice from the Identifier pull-down on the ISPF Settings panel action bar, as shown in Figure 1.
Read more >
Importance of Message-ID in Forensic Analysis of Emails
Message-ID is a unique identifier that helps to distinguish emails across the globe. An email forensics expert can break it down to discover ......
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