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, XD_JSON_OCTET_STREAM_VALUE, XD_OCTET_STREAM_VALUE, XD_TEXT_PLAIN_UTF8_VALUE| Constructor and Description |
|---|
LocalMessageBus() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
bindConsumer(java.lang.String name,
org.springframework.integration.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.integration.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.integration.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.integration.MessageChannel moduleOutputChannel)
Bind a message producer on a pub/sub channel.
|
protected org.springframework.integration.handler.BridgeHandler |
bridge(org.springframework.integration.MessageChannel from,
org.springframework.integration.MessageChannel to,
java.lang.String bridgeName) |
protected org.springframework.integration.handler.BridgeHandler |
bridge(org.springframework.integration.MessageChannel from,
org.springframework.integration.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 |
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
QueueChannels. |
addBridge, deleteBridge, deleteBridges, setBeanClassLoader, setConversionService, stopBridges, transformInboundIfNecessary, transformOutboundIfNecessary, unbindConsumer, unbindConsumers, unbindProducer, unbindProducerspublic void setQueueSize(int queueSize)
QueueChannels.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.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setConvertWithinTransport(boolean convertWithinTransport)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void bindConsumer(java.lang.String name,
org.springframework.integration.MessageChannel moduleInputChannel,
java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes,
boolean aliasHint)
bindConsumer in interface MessageBusname - 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.integration.MessageChannel moduleInputChannel,
java.util.Collection<org.springframework.http.MediaType> acceptedMediaTypes)
MessageBusbindPubSubConsumer in interface MessageBusname - the logical identity of the message sourceacceptedMediaTypes - the media types supported by the channelpublic void bindProducer(java.lang.String name,
org.springframework.integration.MessageChannel moduleOutputChannel,
boolean aliasHint)
bindProducer in interface MessageBusname - 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.integration.MessageChannel moduleOutputChannel)
MessageBusbindPubSubProducer in interface MessageBusname - the logical identity of the message targetprotected <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.integration.MessageChannel from,
org.springframework.integration.MessageChannel to,
java.lang.String bridgeName)
protected org.springframework.integration.handler.BridgeHandler bridge(org.springframework.integration.MessageChannel from,
org.springframework.integration.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)