Class StoredProcMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.jdbc.StoredProcMessageHandler
- All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered,org.springframework.integration.context.ExpressionCapable,org.springframework.integration.context.Orderable,org.springframework.integration.IntegrationPattern,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.IntegrationManagement,org.springframework.integration.support.management.TrackableComponent,org.springframework.messaging.MessageHandler,reactor.core.CoreSubscriber<org.springframework.messaging.Message<?>>
public class StoredProcMessageHandler
extends org.springframework.integration.handler.AbstractMessageHandler
A message handler that executes Stored Procedures for update purposes.
Stored procedure parameter values are by default automatically extracted from
the Payload if the payload's bean properties match the parameters of the Stored
Procedure.
This may be sufficient for basic use cases. For more sophisticated options
consider passing in one or more
ProcedureParameter.
If you need to handle the return parameters of the called stored procedure
explicitly, please consider using a StoredProcOutboundGateway instead.
Also, if you need to execute SQL Functions, please also use the
StoredProcOutboundGateway. As functions are typically used to look up
values, only, the Stored Procedure message handler purposefully does not support
SQL function calls. If you believe there are valid use-cases for that, please file a
feature request at https://jira.springsource.org.- Since:
- 2.1
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger -
Constructor Summary
Constructors Constructor Description StoredProcMessageHandler(StoredProcExecutor storedProcExecutor)Constructor passing in theStoredProcExecutor. -
Method Summary
Modifier and Type Method Description java.lang.StringgetComponentType()protected voidhandleMessageInternal(org.springframework.messaging.Message<?> message)Executes the Stored procedure, delegates to executeStoredProcedure(...).Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribeMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, 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, onInit, 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, wait
-
Constructor Details
-
StoredProcMessageHandler
Constructor passing in theStoredProcExecutor.- Parameters:
storedProcExecutor- Must not be null.
-
-
Method Details
-
getComponentType
public java.lang.String getComponentType()- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.handler.MessageHandlerSupport
-
handleMessageInternal
protected void handleMessageInternal(org.springframework.messaging.Message<?> message)Executes the Stored procedure, delegates to executeStoredProcedure(...). Any return values from the Stored procedure are ignored. Return values are logged at debug level, though.- Specified by:
handleMessageInternalin classorg.springframework.integration.handler.AbstractMessageHandler
-