I have pre-setup RabbitMQ configuration: Exchange-1, Queue-1 with binding using Routing Key "notifications.info". I would like to connect to the existing Queue-1 using MassTransit.
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
{
cfg.Host("rabbitmq://guest:guest@localhost");
cfg.ReceiveEndpoint("Queue-1", e =>
{
e.ConfigureConsumeTopology = false;
e.Consumer<EventConsumer>();
e.Bind("Exchange-1", x =>
{
x.Durable = false;
x.AutoDelete = false;
x.ExchangeType = ExchangeType.Topic;
x.RoutingKey = "notifications.info";
});
});
});
Error:
The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406,
text='PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'Queue-1' in vhost '/':
received 'true' but current is 'false'', classId=40, methodId=10
MassTransit creates exchange `Queue-1'. I don't need to create the extra entities at RabbitMQ. Any options to disable it?
Useful info
bash-5.0# rabbitmqctl list_exchanges name type durable auto_delete internal arguments policy
name type durable auto_delete internal arguments policy
Exchange-1 topic false false false []
Queue-1 fanout false false false []
bash-5.0# rabbitmqctl list_queues name durable auto_delete arguments exclusive
name durable auto_delete arguments exclusive
Queue-1 false false [{"x-queue-type","classic"}] false