Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-1517: Add CompositeContainerCustomizer
Resolves #1517 Add configuration support for multiple ContainerCustomizer at once
- Loading branch information
1 parent
34067d2
commit aa86a02
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...it/src/main/java/org/springframework/amqp/rabbit/config/CompositeContainerCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.springframework.amqp.rabbit.config; | ||
|
||
import java.util.List; | ||
import org.springframework.amqp.rabbit.listener.MessageListenerContainer; | ||
import org.springframework.util.Assert; | ||
|
||
/** | ||
* Implementation of {@link ContainerCustomizer<C>} providing the configuration of multiple customizers at the same time. | ||
*/ | ||
public class CompositeContainerCustomizer<C extends MessageListenerContainer> implements ContainerCustomizer<C> { | ||
|
||
private final List<ContainerCustomizer<C>> customizers; | ||
|
||
public CompositeContainerCustomizer(List<ContainerCustomizer<C>> customizers) { | ||
Assert.notNull(customizers, "At least one customizer must be present"); | ||
this.customizers = customizers; | ||
} | ||
|
||
@Override | ||
public void configure(C container) { | ||
customizers.forEach(c -> c.configure(container)); | ||
} | ||
} |