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
Since the first version of Spring AMQP, the framework has provided its own connection and channel recovery in the event of a broker failure.
987
987
Also, as discussed in <<broker-configuration>>, the `RabbitAdmin` re-declares any infrastructure beans (queues and others) when the connection is re-established.
988
988
It therefore does not rely on the https://www.rabbitmq.com/api-guide.html#recovery[auto-recovery] that is now provided by the `amqp-client` library.
989
-
Spring AMQP now uses the `4.0.x` version of `amqp-client`, which has auto recovery enabled by default.
990
-
Spring AMQP can still use its own recovery mechanisms if you wish, disabling it in the client, (by setting the `automaticRecoveryEnabled` property on the underlying `RabbitMQ connectionFactory` to `false`).
991
-
However, the framework is completely compatible with auto-recovery being enabled.
992
-
This means any consumers you create within your code (perhaps via `RabbitTemplate.execute()`) can be recovered automatically.
989
+
The `amqp-client`, has auto recovery enabled by default.
990
+
There are some incompatibilities between the two recovery mechanisms so, by default, Spring sets the `automaticRecoveryEnabled` property on the underlying `RabbitMQ connectionFactory` to `false`.
991
+
Even if the property is `true`, Spring effectively disables it, by immediately closing any recovered connections.
993
992
994
-
IMPORTANT: Only elements (queues, exchanges, bindings) that are defined as beans will be re-declared after a connection failure.
995
-
Elements declared by invoking `RabbitAdmin.declare*()` methods directly from user code are unknown to the framework and therefore cannot be recovered.
996
-
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>>.
993
+
IMPORTANT: By default, only elements (queues, exchanges, bindings) that are defined as beans will be re-declared after a connection failure.
994
+
See <<declarable-recovery>> for how to change that behavior.
997
995
998
996
[[custom-client-props]]
999
997
==== Adding Custom Client Connection Properties
@@ -5483,7 +5481,7 @@ Normally, the `RabbitAdmin` (s) only recover queues/exchanges/bindings that are
5483
5481
When the connection is re-established, the admin will redeclare the entities.
5484
5482
Normally, entities created by calling `admin.declareQueue(...)`, `admin.declareExchange(...)` and `admin.declareBinding(...)` will not be recovered.
5485
5483
5486
-
Starting with version 2.4, the admin has a new property `redeclareManualDeclarations`; when true, the admin will recover these entities in addition to the beans in the application context.
5484
+
Starting with version 2.4, the admin has a new property `redeclareManualDeclarations`; when `true`, the admin will recover these entities in addition to the beans in the application context.
5487
5485
5488
5486
Recovery of individual declarations will not be performed if `deleteQueue(...)`, `deleteExchange(...)` or `removeBinding(...)` is called.
5489
5487
Associated bindings are removed from the recoverable entities when queues and exchanges are deleted.
0 commit comments