Class RouterSpec<K,R extends AbstractMappingMessageRouter> 
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,reactor.util.function.Tuple2<F,H>>
  
org.springframework.integration.dsl.EndpointSpec<S,ConsumerEndpointFactoryBean,H>
  
org.springframework.integration.dsl.ConsumerEndpointSpec<S,R>
 
org.springframework.integration.dsl.AbstractRouterSpec<RouterSpec<K,R>,R>
  
org.springframework.integration.dsl.RouterSpec<K,R> 
- Type Parameters:
- K- the key type.
- R- the- AbstractMappingMessageRouterimplementation type.
- All Implemented Interfaces:
- DisposableBean,- FactoryBean<reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,,- R>> - InitializingBean,- Lifecycle,- Phased,- SmartLifecycle,- ComponentsRegistration
public class RouterSpec<K,R extends AbstractMappingMessageRouter> 
extends AbstractRouterSpec<RouterSpec<K,R>,R>  
The 
AbstractRouterSpec for an AbstractMappingMessageRouter.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
- 
Field SummaryFields inherited from class org.springframework.integration.dsl.ConsumerEndpointSpecadviceChainFields inherited from class org.springframework.integration.dsl.EndpointSpeccomponentsToRegister, endpointFactoryBean, handlerFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionRouterSpec<K,R> channelKeyFallback(boolean channelKeyFallback) When true (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> channelMapping(K key, String channelName) RouterSpec<K,R> channelMapping(K key, MessageChannel channel) The router mapping configuration based on the provided generic key andMessageChannelbean.RouterSpec<K,R> Make a default output mapping of the router to the parent flow.RouterSpec<K,R> dynamicChannelLimit(int dynamicChannelLimit) Set a limit for how many dynamic channels are retained (for reporting purposes).RouterSpec<K,R> Cannot be invoked ifsubFlowMapping(Object, IntegrationFlow)is used.RouterSpec<K,R> resolutionRequired(boolean resolutionRequired) RouterSpec<K,R> sendTimeout(long sendTimeout) RouterSpec<K,R> subFlowMapping(K key, IntegrationFlow subFlow) Add a subflow as an alternative to achannelMapping(Object, String).RouterSpec<K,R> Cannot be invoked ifsubFlowMapping(Object, IntegrationFlow)is used.Methods inherited from class org.springframework.integration.dsl.AbstractRouterSpecapplySequence, defaultOutputChannel, defaultOutputChannel, defaultSubFlowMapping, ignoreSendFailures, isDefaultToParentFlowMethods inherited from class org.springframework.integration.dsl.ConsumerEndpointSpecadvice, async, autoStartup, customizeMonoReply, doGet, handleMessageAdvice, notPropagatedHeaders, order, phase, poller, reactive, reactive, requiresReply, role, taskScheduler, transactional, transactional, transactional, transactional, transactionalMethods inherited from class org.springframework.integration.dsl.EndpointSpecassertHandler, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, pollerMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Constructor Details- 
RouterSpec
 
- 
- 
Method Details- 
sendTimeout- Overrides:
- sendTimeoutin class- ConsumerEndpointSpec<RouterSpec<K,- R extends AbstractMappingMessageRouter>, - R extends AbstractMappingMessageRouter> 
- Parameters:
- sendTimeout- the send timeout.
- Returns:
- the endpoint spec.
- See Also:
 
- 
resolutionRequired- Parameters:
- resolutionRequired- the resolutionRequired.
- Returns:
- the router spec.
- See Also:
 
- 
dynamicChannelLimitSet a limit for how many dynamic channels are retained (for reporting purposes). When the limit is exceeded, the oldest channel is discarded.NOTE: this does not affect routing, just the reporting which dynamically resolved channels have been routed to. Default 100.- Parameters:
- dynamicChannelLimit- the limit.
- Returns:
- the router spec.
- See Also:
 
- 
prefixCannot be invoked ifsubFlowMapping(Object, IntegrationFlow)is used.- Parameters:
- prefix- the prefix.
- Returns:
- the router spec.
- See Also:
 
- 
suffixCannot be invoked ifsubFlowMapping(Object, IntegrationFlow)is used.- Parameters:
- suffix- the suffix to set.
- Returns:
- the router spec.
- See Also:
 
- 
channelKeyFallbackWhen true (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. Set tofalseto disable this feature.- Parameters:
- channelKeyFallback- false to disable the fallback.
- Returns:
- the router spec.
- Since:
- 6.0
- See Also:
 
- 
channelMapping- Parameters:
- key- the key.
- channelName- the channelName.
- Returns:
- the router spec.
- See Also:
 
- 
channelMappingThe router mapping configuration based on the provided generic key andMessageChannelbean. TheMessageChannelmust be instance ofNamedComponentfor proper target router mapping based on the bean name.- Parameters:
- key- the key.
- channel- the- MessageChannelinstance to use.
- Returns:
- the router spec.
- Since:
- 5.2
- See Also:
 
- 
subFlowMappingAdd a subflow as an alternative to achannelMapping(Object, String).prefix(String)andsuffix(String)cannot be used when subflow mappings are used.If subflow should refer to the external IntegrationFlowbean 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())))- Parameters:
- key- the key.
- subFlow- the subFlow.
- Returns:
- the router spec.
 
- 
defaultOutputToParentFlowMake a default output mapping of the router to the parent flow. Use the next, after router, parent flowMessageChannelas aAbstractMessageRouter.setDefaultOutputChannel(MessageChannel)of this router. This option also disablesAbstractMappingMessageRouter.setChannelKeyFallback(boolean), if not called explicitly afterwards, to skip an attempt to resolve the channel name.- Overrides:
- defaultOutputToParentFlowin class- AbstractRouterSpec<RouterSpec<K,- R extends AbstractMappingMessageRouter>, - R extends AbstractMappingMessageRouter> 
- Returns:
- the router spec.
- Since:
- 6.0
 
- 
getComponentsToRegister- Specified by:
- getComponentsToRegisterin interface- ComponentsRegistration
- Overrides:
- getComponentsToRegisterin class- EndpointSpec<RouterSpec<K,- R extends AbstractMappingMessageRouter>, - ConsumerEndpointFactoryBean, - R extends AbstractMappingMessageRouter> 
 
 
-