Skip to content

Commit f0eae28

Browse files
Update examples in docs based on the latest classes
* Correct Other Resources link Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 91cd3e1 commit f0eae28

File tree

2 files changed

+16
-33
lines changed

2 files changed

+16
-33
lines changed

src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ However, the abstractions have been validated in .NET using Apache Qpid in addit
1212
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.
1313

1414
This overview assumes that you are already familiar with the basics of the AMQP specification.
15-
If not, have a look at the resources listed in xref:index.adoc#resources[Other Resources]
15+
If not, have a look at the resources listed in xref:resources.adoc[Other Resources]
1616

1717
[[message]]
1818
== `Message`
@@ -65,11 +65,11 @@ The following example shows the `Exchange` interface:
6565

6666
[source,java]
6767
----
68-
public interface Exchange {
68+
public interface Exchange extends Declarable {
6969
7070
String getName();
7171
72-
String getExchangeType();
72+
String getType();
7373
7474
boolean isDurable();
7575
@@ -112,13 +112,11 @@ public class Queue {
112112
113113
private final String name;
114114
115-
private volatile boolean durable;
115+
private final boolean durable;
116116
117-
private volatile boolean exclusive;
117+
private final boolean exclusive;
118118
119-
private volatile boolean autoDelete;
120-
121-
private volatile Map<String, Object> arguments;
119+
private final boolean autoDelete;
122120
123121
/**
124122
* 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,
148146
In Spring AMQP, we define a `Binding` class to represent those connections.
149147
This section reviews the basic options for binding queues to exchanges.
150148

151-
You can bind a queue to a `DirectExchange` with a fixed routing key, as the following example shows:
152-
153-
[source,java]
154-
----
155-
new Binding(someQueue, someDirectExchange, "foo.bar");
156-
----
157-
158-
You can bind a queue to a `TopicExchange` with a routing pattern, as the following example shows:
159-
160-
[source,java]
161-
----
162-
new Binding(someQueue, someTopicExchange, "foo.*");
163-
----
164-
165-
You can bind a queue to a `FanoutExchange` with no routing key, as the following example shows:
166-
167-
[source,java]
168-
----
169-
new Binding(someQueue, someFanoutExchange);
170-
----
171-
172-
We also provide a `BindingBuilder` to facilitate a "`fluent API`" style, as the following example shows:
149+
We provide a `BindingBuilder` to facilitate a "fluent API" style, as the following example shows:
173150

174151
[source,java]
175152
----
176-
Binding b = BindingBuilder.bind(someQueue).to(someTopicExchange).with("foo.*");
153+
Queue queue = ...;
154+
// bind a queue to a DirectExchange with a fixed routing key
155+
Binding directBinding = BindingBuilder.bind(queue).to(new DirectExchange("someDirectExchange")).with("foo.bar");
156+
// bind a queue to a TopicExchange with a routing pattern
157+
Binding topicBinding = BindingBuilder.bind(queue).to(new TopicExchange("someTopicExchange")).with("foo.*");
158+
// bind a queue to a FanoutExchange with no routing key
159+
Binding fanoutBinding = BindingBuilder.bind(queue).to(new FanoutExchange("someFanoutExchange"));
177160
----
178161

179162
NOTE: For clarity, the preceding example shows the `BindingBuilder` class, but this style works well when using a static import for the 'bind()' method.

src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public interface AmqpAdmin {
2323
2424
String declareQueue(Queue queue);
2525
26-
void deleteQueue(String queueName);
26+
boolean deleteQueue(String queueName);
2727
2828
void deleteQueue(String queueName, boolean unused, boolean empty);
2929
@@ -37,7 +37,7 @@ public interface AmqpAdmin {
3737
3838
Properties getQueueProperties(String queueName);
3939
40-
QueueInformation getQueueInfo(String queueName);
40+
QueueInformation getQueueInfo(String queueName);
4141
4242
}
4343
----

0 commit comments

Comments
 (0)