Skip to content

Commit

Permalink
GH-777: declareCollections to false by default
Browse files Browse the repository at this point in the history
Fixes #777

Disable declaring collections by default now that `Declarables` is supported.
This is so that Boot 2.1 apps will not have issues without additional configuration
of the `RabbitAdmin`.
  • Loading branch information
garyrussell authored and artembilan committed Sep 14, 2018
1 parent f133585 commit 7011b3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public class RabbitAdmin implements AmqpAdmin, ApplicationContextAware, Applicat

private ApplicationEventPublisher applicationEventPublisher;

private boolean declareCollections = true;
private boolean declareCollections = false;

private TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();

Expand Down
5 changes: 5 additions & 0 deletions src/reference/asciidoc/amqp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3970,6 +3970,11 @@ public static class Config {
}
-----

IMPORTANT: In versions prior to 2.1, you could declare multiple `Declarable` s by defining beans of type `Collection<Declarable>`.
This can cause undesirable side effects in some cases, because the admin has to iterate over all `Collection<?>` beans.
This feature is now disabled in favor of `Declarables` as discussed above.
You can revert to the previous behavior by setting the `RabbitAdmin` property `declareCollections` to `true`.

[[conditional-declaration]]
===== Conditional Declaration

Expand Down
1 change: 1 addition & 0 deletions src/reference/asciidoc/whats-new.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ See <<broker-events>> for more information.

The `RabbitAdmin` will discover beans of type `Declarables` (which is a container for `Declarable` - `Queue`, `Exchange`, `Binding` objects) and declare the contained objects on the broker.
Users are discouraged from using the old mechanism of declaring `<Collection<Queue>>` etc and should use `Declarables` beans instead.
By default, the old mechanism is disabled.
See <<collection-declaration>> for more information.

===== RabbitTemplate Changes
Expand Down

0 comments on commit 7011b3f

Please sign in to comment.