-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Host.RabbitMq] Multiple consumers with varying concurrency #205
Comments
hello @robert94p , By default, the underlying RabbitMq net driver uses a concurrency of 1. For example, try to set this via SMB like so: services.AddSlimMessageBus((mbb) =>
{
mbb.WithProviderRabbitMQ(cfg =>
{
cfg.ConnectionFactory.ConsumerDispatchConcurrency = 2; // default is 1
// ...
}
} Please let me know if this worked for you. |
registered several buses for one consumer. While it works |
Did you try the provided suggestion (with |
Signed-off-by: Tomasz Maruszak <[email protected]>
Signed-off-by: Tomasz Maruszak <[email protected]>
Signed-off-by: Tomasz Maruszak <[email protected]>
As part of #207 I have updated the docs to include information on how to increase concurrency. If you run into any problems, please re-open the issue and let me know. Thanks! |
Moving the following from @robert94p #310 (comment):
|
@robert94p I believe this is a good example of what you are trying to achieve, correct? Here is the preview release to try out: Here is a pseudo sample: services.AddSlimMessageBus(mbb =>
{
mbb.Produce<PingMessage>(x => x
.Exchange("exchange", exchangeType: ExchangeType.Direct)
.RoutingKeyProvider((m, p) => m.Label));
// messages with blue routing key will get 1 concurrency
mbb.Consume<PingMessage>(x => x
.Queue("queue", autoDelete: false)
.ExchangeBinding("orders", routingKey: "blue")
.Instances(1));
// messages with red routing key will get 10 concurrency
mbb.Consume<PingMessage>(x => x
.Queue("queue", autoDelete: false)
.ExchangeBinding("orders", routingKey: "red")
.Instances(10));
}); Let me know if that works for you. |
I just pushed a refined version: With that, the overall concurrency should be improved. |
how to process messages in parallel when using RabbitMq?
The text was updated successfully, but these errors were encountered: