From fe780ad7f0a47c9c9cea69c3b57589dbc4fe62fa Mon Sep 17 00:00:00 2001 From: Tomasz Maruszak Date: Wed, 25 Dec 2024 13:03:32 +0100 Subject: [PATCH] Prepare release --- docs/provider_rabbitmq.md | 29 +++++++++++++++++++++++++++++ src/Host.Plugin.Properties.xml | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/provider_rabbitmq.md b/docs/provider_rabbitmq.md index e9ff12be..666f7c58 100644 --- a/docs/provider_rabbitmq.md +++ b/docs/provider_rabbitmq.md @@ -15,6 +15,8 @@ Please read the [Introduction](intro.md) before reading this provider documentat - [Request-Response](#request-response) - [Topology Provisioning](#topology-provisioning) - [Not Supported](#not-supported) +- [Recipes](#recipes) + - [01 Multiple consumers on the same queue with different concurrency](#01-multiple-consumers-on-the-same-queue-with-different-concurrency) - [Feedback](#feedback) ## Underlying client @@ -365,6 +367,33 @@ This might be useful in case the SMB inferred topology is not desired or there a - [Default type exchanges](https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchange-default) are not yet supported - Broker generated queues are not yet supported. +## Recipes + +### 01 Multiple consumers on the same queue with different concurrency + +The same `queue` will be used to consume messages, however there will be internal message processors running with different concurrency (10 and 1) depending on the message routing key. + +```csharp +services.AddSlimMessageBus(mbb => +{ + mbb.Produce(x => x + .Exchange("exchange", exchangeType: ExchangeType.Direct) + .RoutingKeyProvider((m, p) => m.Label)); + + // messages with blue routing key will get 1 concurrency + mbb.Consume(x => x + .Queue("queue", autoDelete: false) + .ExchangeBinding("orders", routingKey: "blue") + .Instances(1)); + + // messages with red routing key will get 10 concurrency + mbb.Consume(x => x + .Queue("queue", autoDelete: false) + .ExchangeBinding("orders", routingKey: "red") + .Instances(10)); +}); +``` + ## Feedback Open a github issue if you need a feature, have a suggestion for improvement, or want to contribute an enhancement. diff --git a/src/Host.Plugin.Properties.xml b/src/Host.Plugin.Properties.xml index f9bea6cc..ecef57fe 100644 --- a/src/Host.Plugin.Properties.xml +++ b/src/Host.Plugin.Properties.xml @@ -4,7 +4,7 @@ - 2.6.2-rc13 + 2.7.0 \ No newline at end of file