Skip to content

Commit

Permalink
spring-projectsGH-1517: added configuration support for multiple Cont…
Browse files Browse the repository at this point in the history
…ainerCustomizer at once
  • Loading branch information
rfelgent committed Oct 17, 2022
1 parent 6e23963 commit ccd7f3f
Showing 1 changed file with 23 additions and 0 deletions.
@@ -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 lease one customizers must be present");
this.customizers = customizers;
}

@Override
public void configure(C container) {
customizers.forEach(c -> c.configure(container));
}
}

0 comments on commit ccd7f3f

Please sign in to comment.