Skip to content

Respond with basic.cancel-ok to the servers that support it (backport #2113) - #2114

Merged
michaelklishin merged 6 commits into
v5.xfrom
mergify/bp/v5.x/pr-2113
Oct 6, 2026
Merged

michaelklishin merged 6 commits into
v5.xfrom
mergify/bp/v5.x/pr-2113

Conversation

@mergify

@mergify mergify Bot commented Oct 6, 2026

Copy link
Copy Markdown

If the server advertises basic.cancel-ok response support.

The background on this is this: starting with 4.3.0, a delivery acknowledgement timeout does not result in the channel being closed but rather a
basic.cancel sent to the client.

Between about 2011 and 2026, clients never had
the need to respond to such basic.cancel because it was originally a client-sent method
and with consumer cancel notifications (an AMQP 0-9-1 extension), the client-sent confirmation was never required or expected.

Unfortunately, RabbitMQ versions between 4.3.0
and 4.3.6 only clean up the consumer after
a basic.cancel-ok arrives but older versions
cannot handle basic.cancel-ok, hence the new
capability and the conditional confirmation.

The Server Part of the Changes

See rabbitmq/rabbitmq-server#17734 for what's being
changed on the server to restore compatibility with older clients.


This is an automatic backport of pull request #2113 done by [Mergify](https://mergify.com).

michaelklishin and others added 5 commits October 6, 2026 14:38
If the server advertises `basic.cancel-ok` response support.

The background on this is this: starting with `4.3.0`,
a delivery acknowledgement timeout does not result
in the channel being closed but rather a
`basic.cancel` sent to the client.

Between about 2011 and 2026, clients never had
the need to respond to such `basic.cancel` because
it was originally a client method.

Unfortunately, RabbitMQ versions between `4.3.0`
and `4.3.6` only clean up the consumer after
a `basic.cancel-ok` arrives but older versions
cannot handle `basic.cancel-ok`, hence the new
capability and the conditional confirmation.

(cherry picked from commit 1c9a5c0)

# Conflicts:
#	src/test/java/com/rabbitmq/client/test/ChannelNTest.java
(cherry picked from commit 5049c5c)
…ered client callback

(cherry picked from commit 7004178)
(cherry picked from commit 07f413f)
@mergify mergify Bot added the conflicts label Oct 6, 2026
@mergify

mergify Bot commented Oct 6, 2026

Copy link
Copy Markdown
Author

Cherry-pick of 1c9a5c0 has failed:

On branch mergify/bp/v5.x/pr-2113
Your branch is up to date with 'origin/v5.x'.

You are currently cherry-picking commit 1c9a5c0.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   src/main/java/com/rabbitmq/client/ServerCapability.java
	modified:   src/main/java/com/rabbitmq/client/impl/AMQConnection.java
	modified:   src/main/java/com/rabbitmq/client/impl/ChannelN.java
	new file:   src/test/java/com/rabbitmq/client/impl/AMQConnectionCapabilitiesTest.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/test/java/com/rabbitmq/client/test/ChannelNTest.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@michaelklishin michaelklishin added this to the 5.38.0 milestone Oct 6, 2026
@michaelklishin
michaelklishin merged commit b4841d1 into v5.x Oct 6, 2026
4 checks passed
@michaelklishin
michaelklishin deleted the mergify/bp/v5.x/pr-2113 branch October 6, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants