Class StoredProcPollingChannelAdapter
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<Object>
org.springframework.integration.jdbc.StoredProcPollingChannelAdapter
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,MessageSource<Object>
,IntegrationPattern
,NamedComponent
,IntegrationInboundManagement
,IntegrationManagement
A polling channel adapter that creates messages from the payload returned by
executing a stored procedure or Sql function. Optionally an update can be executed
after the execution of the Stored Procedure or Function in order to update
processed rows.
- Since:
- 2.1
- Author:
- Gunnar Hillert, 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.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
-
Constructor Summary
ConstructorDescriptionStoredProcPollingChannelAdapter
(StoredProcExecutor storedProcExecutor) Constructor takingStoredProcExecutor
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
Execute the select query and the update query if provided.void
setExpectSingleResult
(boolean expectSingleResult) This parameter indicates that only one result object shall be returned from the Stored Procedure/Function Call.Methods inherited from class org.springframework.integration.endpoint.AbstractMessageSource
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionService
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs, isObserved, registerObservationRegistry
Methods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternType
-
Constructor Details
-
StoredProcPollingChannelAdapter
Constructor takingStoredProcExecutor
.- Parameters:
storedProcExecutor
- Must not be null.
-
-
Method Details
-
setExpectSingleResult
public void setExpectSingleResult(boolean expectSingleResult) This parameter indicates that only one result object shall be returned from the Stored Procedure/Function Call. If set to true, a resultMap that contains only 1 element, will have that 1 element extracted and returned as payload. If the resultMap contains more than 1 element and expectSingleResult is true, then aMessagingException
is thrown. Otherwise the complete resultMap is returned as theMessage
payload. Important Note: Several databases such as H2 are not fully supported. The H2 database, for example, does not fully support theCallableStatement
semantics and when executing function calls against H2, a result list is returned rather than a single value. Therefore, even if you set expectSingleResult = true, you may end up with a collection being returned.- Parameters:
expectSingleResult
- true if a single result is expected.
-
doReceive
Execute the select query and the update query if provided. Returns the rows returned by the select query. If a RowMapper has been provided, the mapped results are returned.- Specified by:
doReceive
in classAbstractMessageSource<Object>
- Returns:
- The value returned.
-
getComponentType
-