Skip to content

Commit

Permalink
GH-1517: Add CompositeContainerCustomizer
Browse files Browse the repository at this point in the history
Resolves #1517

Add configuration support for multiple ContainerCustomizer at once
  • Loading branch information
rfelgent authored and garyrussell committed Oct 18, 2022
1 parent 3c957f9 commit b3bab6b
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 least one customizer must be present");
this.customizers = customizers;
}

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

0 comments on commit b3bab6b

Please sign in to comment.