Question

I know that with MassTransit you can have a correlation id on your message and you can consume only messages that has the same correlation id.

I did this in a console application but it does not work, it gets all the messages even with different correlation id(s). Actually my "CorrelationId" property is never called.

Thanks

Was it helpful?

Solution

You can only register consumers of this type as an instance-based consumer.

x.Subscribe(s => s.Instance(consumer));

And the instance should have a fixed Guid for the CorrelationId.

This is really something that was put into MT very early on and is not really useful in practice, as the endpoint.SendRequest() feature is better for request/response. For content-based routing the distributor is a better choice.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top