Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 14 additions & 31 deletions src/reference/antora/modules/ROOT/pages/amqp/abstractions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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<String, Object> arguments;
private final boolean autoDelete;

/**
* The queue is durable, non-exclusive and non auto-delete.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -37,7 +37,7 @@ public interface AmqpAdmin {

Properties getQueueProperties(String queueName);

QueueInformation getQueueInfo(String queueName);
QueueInformation getQueueInfo(String queueName);

}
----
Expand Down