Skip to content
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

AMQP 1.0: Support dynamic creation of queues #13231

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

AMQP 1.0: Support dynamic creation of queues #13231

wants to merge 5 commits into from

Conversation

ansd
Copy link
Member

@ansd ansd commented Feb 11, 2025

What?

  1. Support the dynamic field of sources and targets.
  2. Closes Occasional frame loss when shutting down connection supervision tree. #2596.

Why?

  1. This allows AMQP clients to dynamically create exclusive queues, which
    can be useful for RPC workloads.
  2. Support creation of JMS temporary queues over AMQP using the Qpid JMS
    client. Exclusive queues map very nicely to JMS temporary queues
    because:

Although sessions are used to create temporary destinations, this is only
for convenience. Their scope is actually the entire connection. Their
lifetime is that of their connection and any of the connection’s sessions
are allowed to create a consumer for them.

https://jakarta.ee/specifications/messaging/3.1/jakarta-messaging-spec-3.1#creating-temporary-destinations

How?

If the terminus contains the capability temporary-queue as defined in
amqp-bindmap-jms-v1.0-wd10
[5.2] and as sent by Qpid JMS client,
RabbitMQ will create an exclusive queue.
(This allows a future commit to take other actions if capability
temporary-topic will be used, such as the additional creation of bindings.)

No matter what the desired node properties are, RabbitMQ will set the
lifetime policy delete-on-close deleting the exclusive queue when the
link which caused its creation ceases to exist. This means the exclusive
queue will be deleted if either:

  • the link gets detached, or
  • the session ends, or
  • the connection closes

Although the AMQP JMS Mapping and Qpid JMS create only a sending link
with dynamic=true, this commit also supports receiving links with
dynamic=true for non-JMS AMQP clients.

RabbitMQ is free to choose the generated queue name. As suggested by the
AMQP spec, the generated queue name will contain the container-id and link
name unless they are very long.

ansd and others added 2 commits February 11, 2025 09:11
Make AMQP 1.0 connection shut down its sessions before sending the
close frame to the client similar to how the AMQP 0.9.1 connection
shuts down its channels before closing the connection.

This commit avoids concurrent deletion of exclusive queues by the session process
and the classic queue process.
This commit should also fix #2596
 ## What?
Support the `dynamic` field of sources and targets.

 ## Why?
1. This allows AMQP clients to dynamically create exclusive queues, which
   can be useful for RPC workloads.
2. Support creation of JMS temporary queues over AMQP using the Qpid JMS
   client. Exclusive queues map very nicely to JMS temporary queues
   because:

> Although sessions are used to create temporary destinations, this is only
for convenience. Their scope is actually the entire connection. Their
lifetime is that of their connection and any of the connection’s sessions
are allowed to create a consumer for them.

https://jakarta.ee/specifications/messaging/3.1/jakarta-messaging-spec-3.1#creating-temporary-destinations

 ## How?
If the terminus contains the capability `temporary-queue` as defined in
[amqp-bindmap-jms-v1.0-wd10](https://groups.oasis-open.org/higherlogic/ws/public/document?document_id=67638)
[5.2] and as sent by Qpid JMS client,
RabbitMQ will create an exclusive queue.
(This allows a future commit to take other actions if capability
`temporary-topic` will be used, such as the additional creation of bindings.)

No matter what the desired node properties are, RabbitMQ will set the
lifetime policy delete-on-close deleting the exclusive queue when the
link which caused its creation ceases to exist. This means the exclusive
queue will be deleted if either:
* the link gets detached, or
* the session ends, or
* the connection closes

Although the AMQP JMS Mapping and Qpid JMS create only a **sending** link
with `dynamic=true`, this commit also supports **receiving** links with
`dynamic=true` for non-JMS AMQP clients.

RabbitMQ is free to choose the generated queue name. As suggested by the
AMQP spec, the generated queue name will contain the container-id and link
name unless they are very long.

Co-authored-by: Arnaud Cogoluègnes <[email protected]>
@ansd ansd added this to the 4.1.0 milestone Feb 11, 2025
@ansd ansd marked this pull request as ready for review February 11, 2025 17:12
@michaelklishin michaelklishin changed the title Support dynamic creation of queues AMQP 1.0: Support dynamic creation of queues Feb 11, 2025
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.

Occasional frame loss when shutting down connection supervision tree.
2 participants