Class ErrorMessageExceptionTypeRouter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.router.AbstractMessageRouter
org.springframework.integration.router.AbstractMappingMessageRouter
org.springframework.integration.router.ErrorMessageExceptionTypeRouter
- All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>
,Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,Ordered
,ExpressionCapable
,Orderable
,IntegrationPattern
,MessageRouter
,NamedComponent
,IntegrationManagement
,MappingMessageRouterManagement
,TrackableComponent
,MessageHandler
,reactor.core.CoreSubscriber<Message<?>>
public class ErrorMessageExceptionTypeRouter extends AbstractMappingMessageRouter
A Message Router that resolves the target
MessageChannel
for
messages whose payload is a Throwable
.
The channel resolution is based upon the most specific cause
of the error for which a channel-mapping exists.
The channel-mapping can be specified for the super classes to avoid mapping duplication for the particular exception implementation.
- Author:
- Mark Fisher, Oleg Zhurakousky, Artem Bilan, Gary Russell
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description ErrorMessageExceptionTypeRouter()
-
Method Summary
Modifier and Type Method Description protected List<Object>
getChannelKeys(Message<?> message)
Subclasses must implement this method to return the channel keys.protected void
onInit()
Subclasses may implement this for initialization logic.void
removeChannelMapping(String key)
Remove a channel mapping for the given key if present.void
replaceChannelMappings(Properties channelMappings)
Convenience method allowing conversion of a list of mappings in a control-bus message.void
setChannelMapping(String key, String channelName)
Add a channel mapping from the provided key to channel name.void
setChannelMappings(Map<String,String> channelMappings)
Provide mappings from channel keys to channel names.Methods inherited from class org.springframework.integration.router.AbstractMappingMessageRouter
determineTargetChannels, getChannelMappings, getDynamicChannelNames, setChannelKeyFallback, setDynamicChannelLimit, setPrefix, setResolutionRequired, setSuffix
Methods inherited from class org.springframework.integration.router.AbstractMessageRouter
getComponentType, getDefaultOutputChannel, getIntegrationPatternType, getMessagingTemplate, getRequiredConversionService, handleMessageInternal, setApplySequence, setDefaultOutputChannel, setDefaultOutputChannelName, setIgnoreSendFailures, setSendTimeout
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe
Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
ErrorMessageExceptionTypeRouter
public ErrorMessageExceptionTypeRouter()
-
-
Method Details
-
setChannelMappings
Description copied from class:AbstractMappingMessageRouter
Provide mappings from channel keys to channel names. Channel names will be resolved by theDestinationResolver
.- Specified by:
setChannelMappings
in interfaceMappingMessageRouterManagement
- Overrides:
setChannelMappings
in classAbstractMappingMessageRouter
- Parameters:
channelMappings
- The channel mappings.
-
setChannelMapping
Description copied from class:AbstractMappingMessageRouter
Add a channel mapping from the provided key to channel name.- Specified by:
setChannelMapping
in interfaceMappingMessageRouterManagement
- Overrides:
setChannelMapping
in classAbstractMappingMessageRouter
- Parameters:
key
- The key.channelName
- The channel name.
-
removeChannelMapping
Description copied from class:AbstractMappingMessageRouter
Remove a channel mapping for the given key if present.- Specified by:
removeChannelMapping
in interfaceMappingMessageRouterManagement
- Overrides:
removeChannelMapping
in classAbstractMappingMessageRouter
- Parameters:
key
- The key.
-
replaceChannelMappings
Description copied from class:AbstractMappingMessageRouter
Convenience method allowing conversion of a list of mappings in a control-bus message.This is intended to be called via a control-bus; keys and values that are not Strings will be ignored.
Mappings must be delimited with newlines, for example:
"@'myRouter.handler'.replaceChannelMappings('foo=qux \n baz=bar')"
.- Specified by:
replaceChannelMappings
in interfaceMappingMessageRouterManagement
- Overrides:
replaceChannelMappings
in classAbstractMappingMessageRouter
- Parameters:
channelMappings
- The channel mappings.
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classAbstractMessageRouter
-
getChannelKeys
Description copied from class:AbstractMappingMessageRouter
Subclasses must implement this method to return the channel keys. A "key" might be present in this router's "channelMappings", or it could be the channel's name or even the Message Channel instance itself.- Specified by:
getChannelKeys
in classAbstractMappingMessageRouter
- Parameters:
message
- The message.- Returns:
- The channel keys.
-