public class LocalMessageBus extends MessageBusSupport implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
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.logger, ORIGINAL_CONTENT_TYPE_HEADER
Constructor and Description |
---|
LocalMessageBus() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
bindConsumer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleInputChannel,
java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes,
boolean aliasHint)
Looks up or creates a DirectChannel with the given name and creates a bridge from that channel to the provided
channel instance.
|
void |
bindProducer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleOutputChannel,
boolean aliasHint)
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.Collection<org.springframework.http.MediaType> acceptedMediaTypes)
Bind a message consumer on a pub/sub channel
|
void |
bindPubSubProducer(java.lang.String name,
org.springframework.messaging.MessageChannel moduleOutputChannel)
Bind a message producer on a pub/sub channel.
|
protected org.springframework.integration.handler.BridgeHandler |
bridge(org.springframework.messaging.MessageChannel from,
org.springframework.messaging.MessageChannel to,
java.lang.String bridgeName) |
protected org.springframework.integration.handler.BridgeHandler |
bridge(org.springframework.messaging.MessageChannel from,
org.springframework.messaging.MessageChannel to,
java.lang.String bridgeName,
java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes) |
protected <T extends org.springframework.integration.channel.AbstractMessageChannel> |
createSharedChannel(java.lang.String name,
java.lang.Class<T> requiredType) |
protected <T> T |
getBean(java.lang.String name,
java.lang.Class<T> requiredType) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setCodec(MultiTypeCodec<java.lang.Object> codec) |
void |
setConvertWithinTransport(boolean convertWithinTransport)
Determines whether any conversion logic is applied within the local transport.
|
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. |
addBinding, deleteBinding, deleteBindings, stopBindings, transformPayloadForConsumerIfNecessary, transformPayloadForProducerIfNecessary, unbindConsumer, unbindConsumers, unbindProducer, unbindProducers
public void setQueueSize(int queueSize)
QueueChannel
s.public void setPoller(org.springframework.integration.scheduling.PollerMetadata poller)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setConvertWithinTransport(boolean convertWithinTransport)
public void setCodec(MultiTypeCodec<java.lang.Object> codec)
setCodec
in class MessageBusSupport
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void bindConsumer(java.lang.String name, org.springframework.messaging.MessageChannel moduleInputChannel, java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes, boolean aliasHint)
bindConsumer
in interface MessageBus
name
- the logical identity of the message sourcemoduleInputChannel
- the channel bound as a consumeracceptedMediaTypes
- the media types supported by the channelaliasHint
- whether the provided name represents an alias and thus should support late bindingpublic void bindPubSubConsumer(java.lang.String name, org.springframework.messaging.MessageChannel moduleInputChannel, java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes)
MessageBus
bindPubSubConsumer
in interface MessageBus
name
- the logical identity of the message sourcemoduleInputChannel
- the channel bound as a pub/sub consumeracceptedMediaTypes
- the media types supported by the channelpublic void bindProducer(java.lang.String name, org.springframework.messaging.MessageChannel moduleOutputChannel, boolean aliasHint)
bindProducer
in interface MessageBus
name
- the logical identity of the message targetmoduleOutputChannel
- the channel bound as a produceraliasHint
- whether the provided name represents an alias and thus should support late bindingpublic void bindPubSubProducer(java.lang.String name, org.springframework.messaging.MessageChannel moduleOutputChannel)
MessageBus
bindPubSubProducer
in interface MessageBus
name
- the logical identity of the message targetmoduleOutputChannel
- the channel bound as a producerprotected <T extends org.springframework.integration.channel.AbstractMessageChannel> T createSharedChannel(java.lang.String name, java.lang.Class<T> requiredType)
protected org.springframework.integration.handler.BridgeHandler bridge(org.springframework.messaging.MessageChannel from, org.springframework.messaging.MessageChannel to, java.lang.String bridgeName)
protected org.springframework.integration.handler.BridgeHandler bridge(org.springframework.messaging.MessageChannel from, org.springframework.messaging.MessageChannel to, java.lang.String bridgeName, java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes)
protected <T> T getBean(java.lang.String name, java.lang.Class<T> requiredType)