From 99ab64d7aefe4f0b32353caa3b0c6cccd2994474 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Sat, 1 Nov 2025 20:07:42 +0700 Subject: [PATCH 1/2] Update examples based on the latest java class Signed-off-by: Tran Ngoc Nhan --- .../modules/ROOT/pages/amqp/abstractions.adoc | 43 ++++++------------- .../ROOT/pages/amqp/broker-configuration.adoc | 4 +- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc b/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc index 9d7bad429f..07487fdb43 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc @@ -65,11 +65,11 @@ The following example shows the `Exchange` interface: [source,java] ---- -public interface Exchange { +public interface Exchange extends Declarable { String getName(); - String getExchangeType(); + String getType(); boolean isDurable(); @@ -112,13 +112,11 @@ public class Queue { private final String name; - private volatile boolean durable; + private final boolean durable; - private volatile boolean exclusive; + private final boolean exclusive; - private volatile boolean autoDelete; - - private volatile Map arguments; + private final boolean autoDelete; /** * The queue is durable, non-exclusive and non auto-delete. @@ -148,32 +146,17 @@ Given that a producer sends to an exchange and a consumer receives from a queue, In Spring AMQP, we define a `Binding` class to represent those connections. This section reviews the basic options for binding queues to exchanges. -You can bind a queue to a `DirectExchange` with a fixed routing key, as the following example shows: - -[source,java] ----- -new Binding(someQueue, someDirectExchange, "foo.bar"); ----- - -You can bind a queue to a `TopicExchange` with a routing pattern, as the following example shows: - -[source,java] ----- -new Binding(someQueue, someTopicExchange, "foo.*"); ----- - -You can bind a queue to a `FanoutExchange` with no routing key, as the following example shows: - -[source,java] ----- -new Binding(someQueue, someFanoutExchange); ----- - -We also provide a `BindingBuilder` to facilitate a "`fluent API`" style, as the following example shows: +We provide a `BindingBuilder` to facilitate a "fluent API" style, as the following example shows: [source,java] ---- -Binding b = BindingBuilder.bind(someQueue).to(someTopicExchange).with("foo.*"); +Queue queue = ...; +// bind a queue to a DirectExchange with a fixed routing key +Binding directBinding = BindingBuilder.bind(queue).to(new DirectExchange("someDirectExchange")).with("foo.bar"); +// bind a queue to a TopicExchange with a routing pattern +Binding topicBinding = BindingBuilder.bind(queue).to(new TopicExchange("someTopicExchange")).with("foo.*"); +// bind a queue to a FanoutExchange with no routing key +Binding fanoutBinding = BindingBuilder.bind(queue).to(new FanoutExchange("someFanoutExchange")); ---- NOTE: For clarity, the preceding example shows the `BindingBuilder` class, but this style works well when using a static import for the 'bind()' method. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc b/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc index 20377cbd6b..23dda972db 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc @@ -23,7 +23,7 @@ public interface AmqpAdmin { String declareQueue(Queue queue); - void deleteQueue(String queueName); + boolean deleteQueue(String queueName); void deleteQueue(String queueName, boolean unused, boolean empty); @@ -37,7 +37,7 @@ public interface AmqpAdmin { Properties getQueueProperties(String queueName); - QueueInformation getQueueInfo(String queueName); + QueueInformation getQueueInfo(String queueName); } ---- From 11055f53e92a81596cb66e04cfe40ee1ab861260 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Sat, 1 Nov 2025 20:11:56 +0700 Subject: [PATCH 2/2] Correct Other Resources link Signed-off-by: Tran Ngoc Nhan --- src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc b/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc index 07487fdb43..0b3fbf62d3 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc @@ -12,7 +12,7 @@ However, the abstractions have been validated in .NET using Apache Qpid in addit Since AMQP operates at the protocol level, in principle, you can use the RabbitMQ client with any broker that supports the same protocol version, but we do not test any other brokers at present. This overview assumes that you are already familiar with the basics of the AMQP specification. -If not, have a look at the resources listed in xref:index.adoc#resources[Other Resources] +If not, have a look at the resources listed in xref:resources.adoc[Other Resources] [[message]] == `Message`