I create a receiveEndpoint with masstransit and consume it like this :
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
{
cfg.ReceiveEndpoint("my-endpoint", x =>
{
x.Consumer<MyEndpointConsumer>();
});
}
Here my class MyEndpointConsumer :
class MyEndpointConsumer : IConsumer<IMyEndpoint>
{
public Task Consume(ConsumeContext<IMyEndpoint> context)
{
Console.WriteLine("MyEndpointConsumer");
}
}
MassTransit create :
- a queue : "my-endpoint"
- a first exchange : "my-endpoint"
- a second exchange : "IMyEndpoint"
I want to disabled the creation of this second exchange. MassTransit documentation explain that consumer topology is based on "publish topology" (MassTransit documentation) :
The consume topology uses the publish topology to ensure consistent naming of exchanges/topics for message types.
So I try to change publish topology on my interface "IMyEndpoint" :
cfg.Publish<IMyEndpoint>(x =>
{
x.Exclude = true;
});
but nothing change, I try :
[ExcludeFromTopology]
publiv interface IMyEndpoint
nothing change too.
Have got any ideas to prend this exchange creation ?
Thanks for your help.