You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc
+14-31Lines changed: 14 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ However, the abstractions have been validated in .NET using Apache Qpid in addit
12
12
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.
13
13
14
14
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]
16
16
17
17
[[message]]
18
18
== `Message`
@@ -65,11 +65,11 @@ The following example shows the `Exchange` interface:
65
65
66
66
[source,java]
67
67
----
68
-
public interface Exchange {
68
+
public interface Exchange extends Declarable {
69
69
70
70
String getName();
71
71
72
-
String getExchangeType();
72
+
String getType();
73
73
74
74
boolean isDurable();
75
75
@@ -112,13 +112,11 @@ public class Queue {
112
112
113
113
private final String name;
114
114
115
-
private volatile boolean durable;
115
+
private final boolean durable;
116
116
117
-
private volatile boolean exclusive;
117
+
private final boolean exclusive;
118
118
119
-
private volatile boolean autoDelete;
120
-
121
-
private volatile Map<String, Object> arguments;
119
+
private final boolean autoDelete;
122
120
123
121
/**
124
122
* 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,
148
146
In Spring AMQP, we define a `Binding` class to represent those connections.
149
147
This section reviews the basic options for binding queues to exchanges.
150
148
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:
173
150
174
151
[source,java]
175
152
----
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
NOTE: For clarity, the preceding example shows the `BindingBuilder` class, but this style works well when using a static import for the 'bind()' method.
0 commit comments