diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java index 25482e11f7..4186ea208b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java @@ -35,6 +35,13 @@ public interface MessageChannel { */ String getName(); + /** + * Return whether this channel has been designated as a broadcaster. If so, + * any dispatcher retrieving messages from this channel should send each + * message to each of its receivers. + */ + boolean isBroadcaster(); + /** * Send a message, blocking indefinitely if necessary. * diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java index 1d1e60f75f..ba7b29ae80 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java @@ -36,8 +36,11 @@ public class SimpleChannel implements MessageChannel, BeanNameAware { private String name; + private boolean broadcaster = false; + private BlockingQueue> queue; + /** * Create a channel with the specified queue capacity. */ @@ -67,6 +70,14 @@ public class SimpleChannel implements MessageChannel, BeanNameAware { return this.name; } + public boolean isBroadcaster() { + return this.broadcaster; + } + + public void setBroadcaster(boolean broadcaster) { + this.broadcaster = broadcaster; + } + /** * Set the name of this channel to its bean name. This will be invoked * automatically whenever the channel is configured explicitly with a bean