Skip to content

Added support for sendContext#2

Open
alexjoybc wants to merge 1 commit into
yesmarket:masterfrom
alexjoybc:feature/sendcontext
Open

Added support for sendContext#2
alexjoybc wants to merge 1 commit into
yesmarket:masterfrom
alexjoybc:feature/sendcontext

Conversation

@alexjoybc

Copy link
Copy Markdown

Description

This PR includes the following proposed change:

  • Support for MassTransit SendContext

This is more a start for a discussion, I have fork your lib and put it in one of my project.

I was something similar to sending via interface

public interface SubmitOrder
{
    string OrderId { get; }
    DateTime OrderDate { get; }
    decimal OrderAmount { get; }
}

public async Task SendOrder(ISendEndpoint endpoint)
{
    await endpoint.Send<SubmitOrder>(new
    {
        OrderId = "27",
        OrderDate = DateTime.UtcNow,
        OrderAmount = 123.45m
    });
}

and noticed that the uber-trace-id was missing in the message context:

"headers": {
    "uber-trace-id": ""
  },

I did a quick modification to your code to accommodate this, as you can see there's some duplication as I went and copy paste most of your code (really handy btw).

Type of change

  • New feature

How Has This Been Tested?

I have tested this in a different project. no unit testing

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@yesmarket

Copy link
Copy Markdown
Owner

Hi alexjoybc,
Thanks for the feedback. I've added a couple comments to PR to fix duplication (which you mentioned).
In regards to the uber-trace-id on the message headers? You mentioned it's missing, but I'm not sure what this should be...

@alexjoybc

Copy link
Copy Markdown
Author

Just seeing this now... I will have a look next week thanks for the feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants