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>
CONSUMER_RETRY_PROPERTIES, defaultBackOffInitialInterval, defaultBackOffMaxInterval, defaultBackOffMultiplier, defaultConcurrency, defaultMaxAttempts, directChannelProvider, evaluationContext, JOB_CHANNEL_TYPE_PREFIX, logger, MEDIATYPES_MEDIATYPE_ALL, ORIGINAL_CONTENT_TYPE_HEADER, P2P_NAMED_CHANNEL_TYPE_PREFIX, PARTITION_HEADER, PRODUCER_PARTITIONING_PROPERTIES, PUBSUB_NAMED_CHANNEL_TYPE_PREFIX, pubsubChannelProvider, queueChannelProvider
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.http.MediaType> acceptedMediaTypes,
org.springframework.xd.dirt.integration.bus.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.LocalMessageBus.LocalBusPropertiesAccessor properties) |
protected <T> T |
getBean(java.lang.String name,
java.lang.Class<T> requiredType) |
void |
setPoller(org.springframework.integration.scheduling.PollerMetadata poller)
Set the poller to use when QueueChannels are used.
|
void |
unbindProducer(java.lang.String name,
org.springframework.messaging.MessageChannel channel)
Unbind a specific p2p or pub/sub message producer
|
addBinding, afterPropertiesSet, bindExistingProducerDirectlyIfPossible, bindNewProducerDirectlyIfPossible, buildPartitionRoutingExpression, buildRetryTemplateIfRetryEnabled, deleteBinding, deleteBindings, deserializePayloadIfNecessary, determinePartition, doBindDynamicProducer, doBindDynamicPubSubProducer, getApplicationContext, getBeanFactory, getIdGenerator, isNamedChannel, onInit, serializePayloadIfNecessary, setApplicationContext, setCodec, setDefaultBackOffInitialInterval, setDefaultBackOffMaxInterval, setDefaultBackOffMultiplier, setDefaultConcurrency, setDefaultMaxAttempts, setIntegrationEvaluationContext, setPartitionSelector, setQueueSize, stopBindings, unbindConsumer, unbindConsumers, unbindProducers, validateConsumerProperties, validateProducerProperties
public void setPoller(org.springframework.integration.scheduling.PollerMetadata poller)
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.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.http.MediaType> acceptedMediaTypes, org.springframework.xd.dirt.integration.bus.LocalMessageBus.LocalBusPropertiesAccessor properties)
protected <T> T getBean(java.lang.String name, java.lang.Class<T> requiredType)