Skip to content

Commit 2748c66

Browse files
committed
GH-900: Docs: Recovery of Declarable Beans
Fixes #900
1 parent 2f9109a commit 2748c66

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/reference/asciidoc/amqp.adoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ You can bind a queue to a `DirectExchange` with a fixed routing key, as the foll
151151
====
152152
[source,java]
153153
----
154-
new Binding(someQueue, someDirectExchange, "foo.bar")
154+
new Binding(someQueue, someDirectExchange, "foo.bar");
155155
----
156156
====
157157

@@ -160,7 +160,7 @@ You can bind a queue to a `TopicExchange` with a routing pattern, as the followi
160160
====
161161
[source,java]
162162
----
163-
new Binding(someQueue, someTopicExchange, "foo.*")
163+
new Binding(someQueue, someTopicExchange, "foo.*");
164164
----
165165
====
166166

@@ -169,7 +169,7 @@ You can bind a queue to a `FanoutExchange` with no routing key, as the following
169169
====
170170
[source,java]
171171
----
172-
new Binding(someQueue, someFanoutExchange)
172+
new Binding(someQueue, someFanoutExchange);
173173
----
174174
====
175175

@@ -844,6 +844,10 @@ Spring AMQP can still use its own recovery mechanisms if you wish, disabling it
844844
However, the framework is completely compatible with auto-recovery being enabled.
845845
This means any consumers you create within your code (perhaps via `RabbitTemplate.execute()`) can be recovered automatically.
846846

847+
IMPORTANT: Only elements (queues, exchanges, bindings) that are defined as beans will be re-declared after a connection failure.
848+
Elements declared by invoking `RabbitAdmin.declare*()` methods directly from user code are unknown to the framework and therefore cannot be recovered.
849+
If you have a need for a variable number of declarations, consider defining a bean, or beans, of type `Declarables`, as discussed in <<collection-declaration>>.
850+
847851
[[custom-client-props]]
848852
==== Adding Custom Client Connection Properties
849853

@@ -4212,8 +4216,8 @@ The `durable()` method with no parameter is no longer provided.
42124216
[[collection-declaration]]
42134217
===== Declaring Collections of Exchanges, Queues, and Bindings
42144218

4215-
You can wrap collections of declarable objects (`Queue`, `Exchange`, and `Binding`) in `Declarables` objects.
4216-
The `RabbitAdmin` detects such beans in the application context and declares the contained objects on the broker.
4219+
You can wrap collections of `Declarable` objects (`Queue`, `Exchange`, and `Binding`) in `Declarables` objects.
4220+
The `RabbitAdmin` detects such beans (as well as discrete `Declarable` beans) in the application context, and declares the contained objects on the broker whenever a connection is established (initially and after a connection failure).
42174221
The following example shows how to do so:
42184222

42194223
====

0 commit comments

Comments
 (0)