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<?>>
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, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChannelKeys(Message<?> message) Subclasses must implement this method to return the channel keys.protected voidonInit()Subclasses may implement this for initialization logic.voidRemove a channel mapping for the given key if present.voidreplaceChannelMappings(Properties channelMappings) Convenience method allowing conversion of a list of mappings in a control-bus message.voidsetChannelMapping(String key, String channelName) Add a channel mapping from the provided key to channel name.voidsetChannelMappings(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, setSuffixMethods inherited from class org.springframework.integration.router.AbstractMessageRouter
getComponentType, getDefaultOutputChannel, getIntegrationPatternType, getMessagingTemplate, getRequiredConversionService, handleMessageInternal, setApplySequence, setDefaultOutputChannel, setDefaultOutputChannelName, setIgnoreSendFailures, setSendTimeoutMethods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscriber
currentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
ErrorMessageExceptionTypeRouter
public ErrorMessageExceptionTypeRouter()
-
-
Method Details
-
setChannelMappings
Description copied from class:AbstractMappingMessageRouterProvide mappings from channel keys to channel names. Channel names will be resolved by theDestinationResolver.- Specified by:
setChannelMappingsin interfaceMappingMessageRouterManagement- Overrides:
setChannelMappingsin classAbstractMappingMessageRouter- Parameters:
channelMappings- The channel mappings.
-
setChannelMapping
Description copied from class:AbstractMappingMessageRouterAdd a channel mapping from the provided key to channel name.- Specified by:
setChannelMappingin interfaceMappingMessageRouterManagement- Overrides:
setChannelMappingin classAbstractMappingMessageRouter- Parameters:
key- The key.channelName- The channel name.
-
removeChannelMapping
Description copied from class:AbstractMappingMessageRouterRemove a channel mapping for the given key if present.- Specified by:
removeChannelMappingin interfaceMappingMessageRouterManagement- Overrides:
removeChannelMappingin classAbstractMappingMessageRouter- Parameters:
key- The key.
-
replaceChannelMappings
Description copied from class:AbstractMappingMessageRouterConvenience 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:
replaceChannelMappingsin interfaceMappingMessageRouterManagement- Overrides:
replaceChannelMappingsin classAbstractMappingMessageRouter- Parameters:
channelMappings- The channel mappings.
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classAbstractMessageRouter
-
getChannelKeys
Description copied from class:AbstractMappingMessageRouterSubclasses 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:
getChannelKeysin classAbstractMappingMessageRouter- Parameters:
message- The message.- Returns:
- The channel keys.
-