public class LocalMessageBus extends MessageBusSupport
MessageBus
for in-process use. For inbound and outbound, creates a
DirectChannel
or a QueueChannel
depending on whether the binding is aliased or not then bridges the
passed MessageChannel
to the channel which is registered in the given application context. If that channel
does not yet exist, it will be created.MessageBusSupport.DirectHandler, MessageBusSupport.PartitioningMetadata, MessageBusSupport.SetBuilder, MessageBusSupport.SharedChannelProvider<T extends org.springframework.messaging.MessageChannel>
MessageBus.Capability
Modifier and Type | Field and Description |
---|---|
protected static java.util.Set<java.lang.Object> |
CONSUMER_REQUEST_REPLY_PROPERTIES |
CONSUMER_RETRY_PROPERTIES, CONSUMER_STANDARD_PROPERTIES, defaultBackOffInitialInterval, defaultBackOffMaxInterval, defaultBackOffMultiplier, defaultBatchBufferLimit, defaultBatchingEnabled, defaultBatchSize, defaultBatchTimeout, defaultCompress, defaultConcurrency, defaultDurableSubscription, defaultMaxAttempts, directChannelProvider, evaluationContext, JOB_CHANNEL_TYPE_PREFIX, logger, MEDIATYPES_MEDIATYPE_ALL, P2P_NAMED_CHANNEL_TYPE_PREFIX, PARTITION_HEADER, PRODUCER_BATCHING_ADVANCED_PROPERTIES, PRODUCER_BATCHING_BASIC_PROPERTIES, PRODUCER_PARTITIONING_PROPERTIES, PRODUCER_STANDARD_PROPERTIES, PUBSUB_NAMED_CHANNEL_TYPE_PREFIX
Constructor and Description |
---|
LocalMessageBus() |
Modifier and Type | Method and Description |
---|---|
void |
bindConsumer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleInputChannel,
java.util.Properties properties)
Looks up or creates a DirectChannel with the given name and creates a bridge from that channel to the provided
channel instance.
|
org.springframework.messaging.MessageChannel |
bindDynamicProducer(java.lang.String name,
java.util.Properties properties)
For the local bus we bridge the router "output" channel to a queue channel; the queue
channel gets the name and the source channel is named 'dynamic.output.to.' + name.
|
org.springframework.messaging.MessageChannel |
bindDynamicPubSubProducer(java.lang.String name,
java.util.Properties properties)
For the local bus we bridge the router "output" channel to a pub/sub channel; the pub/sub
channel gets the name and the source channel is named 'dynamic.output.to.' + name.
|
void |
bindProducer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleOutputChannel,
java.util.Properties properties)
Looks up or creates a DirectChannel with the given name and creates a bridge to that channel from the provided
channel instance.
|
void |
bindPubSubConsumer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleInputChannel,
java.util.Properties properties)
Bind a message consumer on a pub/sub channel
|
void |
bindPubSubProducer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleOutputChannel,
java.util.Properties properties)
Bind a message producer on a pub/sub channel.
|
void |
bindReplier(java.lang.String name,
org.springframework.messaging.MessageChannel requests,
org.springframework.messaging.MessageChannel replies,
java.util.Properties properties)
Bind a consumer that handles requests from a requestor and asynchronously sends replies.
|
void |
bindRequestor(java.lang.String name,
org.springframework.messaging.MessageChannel requests,
org.springframework.messaging.MessageChannel replies,
java.util.Properties properties)
Bind a producer that expects async replies.
|
protected org.springframework.integration.handler.BridgeHandler |
bridge(java.lang.String name,
org.springframework.messaging.MessageChannel from,
org.springframework.messaging.MessageChannel to,
java.lang.String bridgeName,
java.util.Collection<org.springframework.util.MimeType> acceptedMimeTypes,
org.springframework.xd.dirt.integration.bus.local.LocalMessageBus.LocalBusPropertiesAccessor properties) |
protected org.springframework.integration.handler.BridgeHandler |
bridge(java.lang.String name,
org.springframework.messaging.MessageChannel from,
org.springframework.messaging.MessageChannel to,
java.lang.String bridgeName,
org.springframework.xd.dirt.integration.bus.local.LocalMessageBus.LocalBusPropertiesAccessor properties) |
protected <T> T |
getBean(java.lang.String name,
java.lang.Class<T> requiredType) |
protected void |
onInit() |
void |
setExecutorCorePoolSize(int executorCorePoolSize)
Set the
ThreadPoolTaskExecutor } core pool size to limit the number of concurrent
threads. |
void |
setExecutorKeepAliveSeconds(int executorKeepAliveSeconds)
Set the
ThreadPoolTaskExecutor } keep alive seconds. |
void |
setExecutorMaxPoolSize(int executorMaxPoolSize)
Set the
ThreadPoolTaskExecutor } max pool size to limit the number of concurrent
threads. |
void |
setExecutorQueueSize(int executorQueueSize)
Set the
ThreadPoolTaskExecutor } queue size to limit the number of concurrent
threads. |
void |
setPoller(org.springframework.integration.scheduling.PollerMetadata poller)
Set the poller to use when QueueChannels are used.
|
void |
setQueueSize(int queueSize)
Set the size of the queue when using
QueueChannel s. |
void |
unbindProducer(java.lang.String name,
org.springframework.messaging.MessageChannel channel)
Unbind a specific p2p or pub/sub message producer
|
addBinding, afterPropertiesSet, applyPrefix, applyPubSub, applyRequests, bindExistingProducerDirectlyIfPossible, bindNewProducerDirectlyIfPossible, buildPartitionRoutingExpression, buildRetryTemplateIfRetryEnabled, constructDLQName, deleteBinding, deleteBindings, deserializePayloadIfNecessary, deserializePayloadIfNecessary, determinePartition, doBindDynamicProducer, doBindDynamicPubSubProducer, doManualAck, getApplicationContext, getBeanFactory, getIdGenerator, isCapable, isNamedChannel, serializePayloadIfNecessary, setApplicationContext, setCodec, setDefaultBackOffInitialInterval, setDefaultBackOffMaxInterval, setDefaultBackOffMultiplier, setDefaultBatchBufferLimit, setDefaultBatchingEnabled, setDefaultBatchSize, setDefaultBatchTimeout, setDefaultCompress, setDefaultConcurrency, setDefaultDurableSubscription, setDefaultMaxAttempts, setIntegrationEvaluationContext, setPartitionSelector, stopBindings, unbindConsumer, unbindConsumers, unbindProducers, validateConsumerProperties, validateProducerProperties
protected static final java.util.Set<java.lang.Object> CONSUMER_REQUEST_REPLY_PROPERTIES
public void setPoller(org.springframework.integration.scheduling.PollerMetadata poller)
public void setQueueSize(int queueSize)
QueueChannel
s.public void setExecutorCorePoolSize(int executorCorePoolSize)
ThreadPoolTaskExecutor
} core pool size to limit the number of concurrent
threads. The executor is used for PubSub operations.
Default: 0 (threads created on demand until maxPoolSize).executorCorePoolSize
- the pool size.public void setExecutorMaxPoolSize(int executorMaxPoolSize)
ThreadPoolTaskExecutor
} max pool size to limit the number of concurrent
threads. The executor is used for PubSub operations.
Default: 200.executorMaxPoolSize
- the pool size.public void setExecutorQueueSize(int executorQueueSize)
ThreadPoolTaskExecutor
} queue size to limit the number of concurrent
threads. The executor is used for PubSub operations.
Default: Integer.MAX_VALUE
.executorQueueSize
- the queue size.public void setExecutorKeepAliveSeconds(int executorKeepAliveSeconds)
ThreadPoolTaskExecutor
} keep alive seconds.
The executor is used for PubSub operations.executorKeepAliveSeconds
- the keep alive seconds.protected void onInit()
onInit
in class MessageBusSupport
public org.springframework.messaging.MessageChannel bindDynamicProducer(java.lang.String name, java.util.Properties properties)
bindDynamicProducer
in interface MessageBus
bindDynamicProducer
in class MessageBusSupport
name
- The name.properties
- The properties.public org.springframework.messaging.MessageChannel bindDynamicPubSubProducer(java.lang.String name, java.util.Properties properties)
bindDynamicPubSubProducer
in interface MessageBus
bindDynamicPubSubProducer
in class MessageBusSupport
name
- The name.properties
- The properties.public void bindConsumer(java.lang.String name, org.springframework.messaging.MessageChannel moduleInputChannel, java.util.Properties properties)
name
- the logical identity of the message sourcemoduleInputChannel
- the channel bound as a consumerproperties
- arbitrary String key/value pairs that will be used in the bindingpublic void bindPubSubConsumer(java.lang.String name, org.springframework.messaging.MessageChannel moduleInputChannel, java.util.Properties properties)
MessageBus
name
- the logical identity of the message sourcemoduleInputChannel
- the channel bound as a pub/sub consumerproperties
- arbitrary String key/value pairs that will be used in the bindingpublic void bindProducer(java.lang.String name, org.springframework.messaging.MessageChannel moduleOutputChannel, java.util.Properties properties)
name
- the logical identity of the message targetmoduleOutputChannel
- the channel bound as a producerproperties
- arbitrary String key/value pairs that will be used in the bindingpublic void bindPubSubProducer(java.lang.String name, org.springframework.messaging.MessageChannel moduleOutputChannel, java.util.Properties properties)
MessageBus
name
- the logical identity of the message targetmoduleOutputChannel
- the channel bound as a producerproperties
- arbitrary String key/value pairs that will be used in the bindingpublic void bindRequestor(java.lang.String name, org.springframework.messaging.MessageChannel requests, org.springframework.messaging.MessageChannel replies, java.util.Properties properties)
MessageBus
name
- The name of the requestor.requests
- The request channel - sends requests.replies
- The reply channel - receives replies.properties
- arbitrary String key/value pairs that will be used in the binding.public void bindReplier(java.lang.String name, org.springframework.messaging.MessageChannel requests, org.springframework.messaging.MessageChannel replies, java.util.Properties properties)
MessageBus
name
- The name of the requestor for which this replier will handle requests.requests
- The request channel - receives requests.replies
- The reply channel - sends replies.properties
- arbitrary String key/value pairs that will be used in the binding.public void unbindProducer(java.lang.String name, org.springframework.messaging.MessageChannel channel)
MessageBus
unbindProducer
in interface MessageBus
unbindProducer
in class MessageBusSupport
name
- the logical identity of the message targetchannel
- the channel bound as a producerprotected org.springframework.integration.handler.BridgeHandler bridge(java.lang.String name, org.springframework.messaging.MessageChannel from, org.springframework.messaging.MessageChannel to, java.lang.String bridgeName, org.springframework.xd.dirt.integration.bus.local.LocalMessageBus.LocalBusPropertiesAccessor properties)
protected org.springframework.integration.handler.BridgeHandler bridge(java.lang.String name, org.springframework.messaging.MessageChannel from, org.springframework.messaging.MessageChannel to, java.lang.String bridgeName, java.util.Collection<org.springframework.util.MimeType> acceptedMimeTypes, org.springframework.xd.dirt.integration.bus.local.LocalMessageBus.LocalBusPropertiesAccessor properties)
protected <T> T getBean(java.lang.String name, java.lang.Class<T> requiredType)