Skip to content

Commit b3bab6b

Browse files
rfelgentgaryrussell
authored andcommitted
GH-1517: Add CompositeContainerCustomizer
Resolves #1517 Add configuration support for multiple ContainerCustomizer at once
1 parent 3c957f9 commit b3bab6b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.springframework.amqp.rabbit.config;
2+
3+
import java.util.List;
4+
import org.springframework.amqp.rabbit.listener.MessageListenerContainer;
5+
import org.springframework.util.Assert;
6+
7+
/**
8+
* Implementation of {@link ContainerCustomizer<C>} providing the configuration of multiple customizers at the same time.
9+
*/
10+
public class CompositeContainerCustomizer<C extends MessageListenerContainer> implements ContainerCustomizer<C> {
11+
12+
private final List<ContainerCustomizer<C>> customizers;
13+
14+
public CompositeContainerCustomizer(List<ContainerCustomizer<C>> customizers) {
15+
Assert.notNull(customizers, "At least one customizer must be present");
16+
this.customizers = customizers;
17+
}
18+
19+
@Override
20+
public void configure(C container) {
21+
customizers.forEach(c -> c.configure(container));
22+
}
23+
}

0 commit comments

Comments
 (0)