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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top