Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluggable message id strategy #69

Merged
merged 2 commits into from
Jan 9, 2015
Merged

Conversation

andreasohlund
Copy link
Member

The strategy for detecting message id's are now pluggable to provide better interop with non NServiceBus endpoints

Part of fixing #13

Documentation

By default NServiceBus uses the message-id property of the AMQP standard to relay the stable message id. If this header isn't set the transport will throw an exception since NServiceBus needs a message id in order to perform retries, deduplication etc in a safe way. In integration scenarios where you might not control the sender you might want to use your own custom scheme eg. a customer header or some data contained in the actual message body. In these cases you can plugin in your own strategy by calling: insert final config call here.

@andreasohlund andreasohlund added this to the 2.1.0 milestone Jan 7, 2015
var properties = channel.CreateBasicProperties();

//for now until we can patch the serializer to infer the type based on the root node
properties.Headers = new Dictionary<string, object> { { Headers.EnclosedMessageTypes, typeof(MyRequest).FullName } };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonCropp @johnsimons @yvesgoeleven should we consider making the serializers smarter when it comes to inferring messages type to make external integrations easier? (json serializers also needs to the header to be set)

For XML we can match on the root node and for json we can use the $type thing?

@andreasohlund
Copy link
Member Author

@johnsimons can you review this one?

andreasohlund added a commit that referenced this pull request Jan 9, 2015
@andreasohlund andreasohlund merged commit d023b3d into develop Jan 9, 2015
@andreasohlund andreasohlund deleted the message-id-strategy branch January 9, 2015 08:48
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.

1 participant