Skip to content

SW-Bus 10.1: RabbitMQ.Client 7, per-queue concurrency, publisher confirms, drain - #90

Merged
samerzughul merged 2 commits into
mainfrom
feat/rabbitmq-client-7
Oct 14, 2026
Merged

samerzughul merged 2 commits into
mainfrom
feat/rabbitmq-client-7

Conversation

@samerzughul

Copy link
Copy Markdown
Member

Moves SW.Bus to RabbitMQ.Client 7 and publishes it as 10.1.0 (a minor release, not 11.0).

What changes

  • RabbitMQ.Client 6.8.1 to 7.2.2.
  • Per-queue consumer concurrency: ConsumerOptions.Concurrency, AddQueueOption(concurrency:), BusOptions.DefaultConsumerConcurrency. The default is 1, the same as 10.0. Prefetch still caps it, and changing it on refresh moves the consumer to a new channel without processing anything twice.
  • Publisher confirms (BusOptions.PublisherConfirms, default true): a publish completes only when the broker has the message, and throws otherwise. There is one publish channel per DI scope instead of one shared channel.
  • BusConnection: connections open asynchronously after the host starts, and exchanges are declared then, with retries. AddBus and AddBusPublish no longer connect. The client's automatic recovery handles reconnects. IBusConnectionStatus reports whether the bus is connected.
  • Drain on stop (BusOptions.DrainTimeout, default 30 s): running messages finish and are acked, and the rest go back to their queue.
  • Queue names, arguments, bindings, retry and bad-queue TTLs, and exchanges are unchanged, so 10.0 and 10.1 nodes can run side by side during a rollout.

Before upgrading

  • The public bus interfaces and option names are unchanged. However, RabbitMQ.Client 7 comes in as a transitive dependency, so a project that uses the 6.x client API directly will need to move to 7. Bitween-api's integration tests and SW-Serverless reference 6.8.1 directly.
  • Publisher confirms are on by default. A publish can now throw where it used to fail silently, and each publish waits for the broker. Set PublisherConfirms = false to keep the 10.0 behaviour.

Tests

  • The SW.Bus unit tests and the build pass.
  • New integration tests cover concurrency, ordering at concurrency 1, confirms, broker restart, booting with the broker down, drain, retry and the bad queue.

Merging to main publishes SimplyWorks.Bus, SimplyWorks.Bus.RabbitMqExtensions and SimplyWorks.Bus.RabbitMqViewer 10.1.0 to nuget.org.

…irms, drain

- RabbitMQ.Client 6.8.1 to 7.2.2; package major 11.
- Per-queue consumer concurrency: ConsumerOptions.Concurrency, AddQueueOption(concurrency:),
  BusOptions.DefaultConsumerConcurrency (default 1, the 10.x behaviour). Each queue's channel
  is created with that dispatch concurrency; prefetch still caps it. A refresh that changes
  it moves the consumer to a new channel and retires the old one once its running messages
  are acknowledged, so nothing is processed twice.
- Publisher confirms (BusOptions.PublisherConfirms, default true): a publish completes when
  the broker has the message and throws otherwise. One channel per DI scope, opened on first
  publish, instead of one shared channel for the process.
- BusConnection: publisher and consumer connections opened asynchronously after the host
  starts, exchanges declared there with retries; AddBus and AddBusPublish no longer connect.
  The client's automatic recovery owns reconnects and topology. IBusConnectionStatus reports
  whether the bus is connected.
- Drain on stop (BusOptions.DrainTimeout, default 30 s): no new message starts, consumers are
  cancelled, running messages finish and ack, the rest return to their queue. Channel and
  connection closes are bounded because client 7 waits for running handlers on close.
- Queue names, arguments, bindings, retry and bad queue TTLs and exchanges unchanged; the
  bad-queue copy drops the client's x-dotnet-pub-seq-no header as it drops x-death.
- Integration tests for concurrency, order at 1, confirms, broker restart, boot with the
  broker down, drain, retry and bad queue; README options, behaviour and upgrade notes.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: simplify9/coderabbit/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cd835942-50dc-4abb-a5a1-43e1315e0c99
📥 Commits

Reviewing files that changed from the base of the PR and between 79332eb and 4a6034b.

📒 Files selected for processing: 21
  • .github/workflows/nuget-publish.yml
  • README.md
  • SW.Bus.IntegrationTests/Broker.cs
  • SW.Bus.IntegrationTests/BusHarness.cs
  • SW.Bus.IntegrationTests/ConcurrencyTests.cs
  • SW.Bus.IntegrationTests/ConnectionTests.cs
  • SW.Bus.IntegrationTests/ConsumerRefreshTests.cs
  • SW.Bus.IntegrationTests/DrainAndRetryTests.cs
  • SW.Bus.IntegrationTests/WorkConsumer.cs
  • SW.Bus.RabbitMqExtensions/ConsumerOptions.cs
  • SW.Bus.RabbitMqExtensions/IBusConnectionStatus.cs
  • SW.Bus.RabbitMqExtensions/SW.Bus.RabbitMqExtensions.csproj
  • SW.Bus/BasicPublisher.cs
  • SW.Bus/BusConnection.cs
  • SW.Bus/BusOptions.cs
  • SW.Bus/ConsumerDefinition.cs
  • SW.Bus/ConsumerRunner.cs
  • SW.Bus/ConsumersService.cs
  • SW.Bus/IServiceCollectionExtensions.cs
  • SW.Bus/OperationalEventInfrastructure.cs
  • SW.Bus/SW.Bus.csproj
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@samerzughul
samerzughul merged commit 8e21cc5 into main Oct 14, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant