K
- the key type.R
- the AbstractMappingMessageRouter
implementation type.public final class RouterSpec<K,R extends AbstractMappingMessageRouter> extends AbstractRouterSpec<RouterSpec<K,R>,R>
AbstractRouterSpec
for an AbstractMappingMessageRouter
.adviceChain
componentsToRegister, endpointFactoryBean, handler
PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Modifier | Constructor and Description |
---|---|
protected |
RouterSpec(R router) |
Modifier and Type | Method and Description |
---|---|
RouterSpec<K,R> |
channelMapping(K key,
MessageChannel channel)
The router mapping configuration based on the provided generic key
and
MessageChannel bean. |
RouterSpec<K,R> |
channelMapping(K key,
String channelName) |
RouterSpec<K,R> |
dynamicChannelLimit(int dynamicChannelLimit)
Set a limit for how many dynamic channels are retained (for reporting purposes).
|
Map<Object,String> |
getComponentsToRegister() |
RouterSpec<K,R> |
noChannelKeyFallback()
By default, if a resolved channel key does not exist in the channel map, the key
itself is used as the channel name, which we will attempt to resolve to a channel.
|
RouterSpec<K,R> |
prefix(String prefix)
Cannot be invoked if
subFlowMapping(Object, IntegrationFlow) is used. |
RouterSpec<K,R> |
resolutionRequired(boolean resolutionRequired) |
RouterSpec<K,R> |
subFlowMapping(K key,
IntegrationFlow subFlow)
Add a subflow as an alternative to a
channelMapping(Object, String) . |
RouterSpec<K,R> |
suffix(String suffix)
Cannot be invoked if
subFlowMapping(Object, IntegrationFlow) is used. |
applySequence, defaultOutputChannel, defaultOutputChannel, defaultOutputToParentFlow, defaultSubFlowMapping, ignoreSendFailures, isDefaultToParentFlow
advice, async, autoStartup, customizeMonoReply, doGet, handleMessageAdvice, notPropagatedHeaders, order, phase, poller, requiresReply, role, sendTimeout, taskScheduler, transactional, transactional, transactional, transactional, transactional
assertHandler, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, poller
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
protected RouterSpec(R router)
public RouterSpec<K,R> resolutionRequired(boolean resolutionRequired)
resolutionRequired
- the resolutionRequired.AbstractMappingMessageRouter.setResolutionRequired(boolean)
public RouterSpec<K,R> dynamicChannelLimit(int dynamicChannelLimit)
NOTE: this does not affect routing, just the reporting which dynamically
resolved channels have been routed to. Default 100
.
dynamicChannelLimit
- the limit.AbstractMappingMessageRouter.setDynamicChannelLimit(int)
public RouterSpec<K,R> prefix(String prefix)
subFlowMapping(Object, IntegrationFlow)
is used.prefix
- the prefix.AbstractMappingMessageRouter.setPrefix(String)
public RouterSpec<K,R> suffix(String suffix)
subFlowMapping(Object, IntegrationFlow)
is used.suffix
- the suffix to set.AbstractMappingMessageRouter.setSuffix(String)
public RouterSpec<K,R> noChannelKeyFallback()
public RouterSpec<K,R> channelMapping(K key, String channelName)
key
- the key.channelName
- the channelName.AbstractMappingMessageRouter.setChannelMapping(String, String)
public RouterSpec<K,R> channelMapping(K key, MessageChannel channel)
MessageChannel
bean.
The MessageChannel
must be instance of NamedComponent
for proper target router mapping based on the bean name.key
- the key.channel
- the MessageChannel
instance to use.AbstractMappingMessageRouter.setChannelMapping(String, String)
public RouterSpec<K,R> subFlowMapping(K key, IntegrationFlow subFlow)
channelMapping(Object, String)
.
prefix(String)
and suffix(String)
cannot be used when subflow
mappings are used.
If subflow should refer to the external IntegrationFlow
bean and
there is a requirement to expect reply from there, such a reference should be
wrapped with a .gateway()
:
.subFlowMapping(false, sf -> sf.gateway(evenFlow())))
key
- the key.subFlow
- the subFlow.public Map<Object,String> getComponentsToRegister()
getComponentsToRegister
in interface ComponentsRegistration
getComponentsToRegister
in class EndpointSpec<RouterSpec<K,R extends AbstractMappingMessageRouter>,ConsumerEndpointFactoryBean,R extends AbstractMappingMessageRouter>