Answer the question
In order to leave comments, you need to log in
How to configure MassTransit + RabbitMQ so that multiple consuming threads get all copies of published messages?
Hello!
Can you please tell me how to set up the bus so that every message posted to the queue is received by every consumer. Now I have one process publishing and receiving messages to / from the queue and two processes simply receive messages from the queue and at the same time, each message goes to only one process, i.e. they all take turns processing the message stream. how to make the message be consumed by each process.
I set up the queue like this:
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
{
var host = cfg.Host(new Uri("rabbitmq://localhost/"), h =>
{
h.Username("guest");
h.Password("guest");
});
cfg.ReceiveEndpoint(host,"customer_update_queue", ec =>
{
ec.LoadFrom(_instance);
});
});
_instance.RegisterInstance<IBusControl>(busControl);
_instance.RegisterInstance<IBus>(busControl);
busControl.Start();
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
{
var host = cfg.Host(new Uri("rabbitmq://localhost/"), h =>
{
h.Username("guest");
h.Password("guest");
});
cfg.ReceiveEndpoint(host, "customer_update_queue", ec =>
{
//ec.Consumer<SmsService>();
SmsService s = new SmsService();
ec.Instance(s);
});
});
busControl.Start();
Answer the question
In order to leave comments, you need to log in
Stop configuring crawl architecture in code. This will not lead to good. Go to their website - there are excellent tutorials. In general, you need an exchange to which several queues are attached
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question