Skip to content

Add publisher confirms tutorial using ConfirmationPublisher - #707

Open
lukebakken wants to merge 2 commits into
mainfrom
lukebakken/publisher-confirm-tracking
Open

Add publisher confirms tutorial using ConfirmationPublisher#707
lukebakken wants to merge 2 commits into
mainfrom
lukebakken/publisher-confirm-tracking

Conversation

@lukebakken

@lukebakken lukebakken commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

The new ConfirmationPublisher API introduced in rabbitmq/rabbitmq-java-client#1824 provides asynchronous publisher confirmation tracking with a CompletableFuture-based API, optional bounded-outstanding backpressure, and message correlation support.

This change adds PublisherConfirmsAsync.java to demonstrate the ConfirmationPublisher API. The tutorial shows how to create a ConfirmationPublisher from a Connection with a bound on outstanding confirmations, publish messages asynchronously with a correlation context, handle nacks and returns through PublishException, and wait for all confirmations using CompletableFuture.allOf().

Depends on rabbitmq/rabbitmq-java-client#1824

@michaelklishin

Copy link
Copy Markdown
Contributor

Whoops, this has slipped through the cracks in December.

@lukebakken

Copy link
Copy Markdown
Collaborator Author

No worries, these changes depend on unmerged PR rabbitmq/rabbitmq-java-client#1824

The new `ConfirmationChannel` API introduced in
rabbitmq/rabbitmq-java-client#1824 provides asynchronous publisher
confirmation tracking with a `CompletableFuture`-based API, rate
limiting, and message correlation support.

This change adds `PublisherConfirmsAsync.java` to demonstrate the
`ConfirmationChannel` API. The tutorial shows how to create a
`ConfirmationChannel` wrapper with rate limiting, publish messages
asynchronously with correlation context, and wait for all confirmations
using `CompletableFuture.allOf()`.

Depends on rabbitmq/rabbitmq-java-client#1824
@lukebakken
lukebakken force-pushed the lukebakken/publisher-confirm-tracking branch from 908d1d5 to 807628e Compare July 12, 2026 20:27
The java client reworked the async confirmation API from ConfirmationChannel,
which wrapped a Channel and took a RateLimiter, to a standalone
ConfirmationPublisher created from a Connection with an optional bound on
outstanding confirmations. Update the tutorial to match: the publisher owns
its own channel, the application declares its queue on a separate channel,
and backpressure is expressed as a maximum number of unconfirmed messages.
@lukebakken lukebakken changed the title Add publisher confirms tutorial using ConfirmationChannel Add publisher confirms tutorial using ConfirmationPublisher Jul 12, 2026
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.

2 participants