Class JdbcMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.jdbc.outbound.JdbcMessageHandler
org.springframework.integration.jdbc.JdbcMessageHandler
- All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>
,Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,Ordered
,ComponentSourceAware
,ExpressionCapable
,Orderable
,IntegrationPattern
,NamedComponent
,IntegrationManagement
,TrackableComponent
,MessageHandler
,reactor.core.CoreSubscriber<Message<?>>
@Deprecated(forRemoval=true,
since="7.0")
public class JdbcMessageHandler
extends JdbcMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.
A message handler that executes an SQL update. Dynamic query parameters are supported through the
SqlParameterSourceFactory
abstraction, the default implementation of which wraps the message so that its bean
properties can be referred to by name in the query string, e.g.
INSERT INTO ITEMS (MESSAGE_ID, PAYLOAD) VALUES (:headers[id], :payload)
When a message payload is an instance of Iterable
, a
NamedParameterJdbcOperations.batchUpdate(String, SqlParameterSource[])
is performed, where each
SqlParameterSource
instance is based on items wrapped into an internal Message
implementation with
headers from the request message. The item is wrapped only if it is not a Message
already.
N.B. do not use quotes to escape the header keys. The default SQL parameter source (from Spring JDBC) can also handle
headers with dotted names (e.g. business.id
)
- Since:
- 2.0
- Author:
- Dave Syer, Artem Bilan, Trung Pham
-
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
ConstructorsConstructorDescriptionJdbcMessageHandler
(DataSource dataSource, String updateSql) Deprecated, for removal: This API element is subject to removal in a future version.Constructor takingDataSource
from which the DB Connection can be obtained and the select query to execute to retrieve new rows.JdbcMessageHandler
(JdbcOperations jdbcOperations, String updateSql) Deprecated, for removal: This API element is subject to removal in a future version.Constructor takingJdbcOperations
instance to use for query execution and the select query to execute to retrieve new rows. -
Method Summary
Methods inherited from class org.springframework.integration.jdbc.outbound.JdbcMessageHandler
executeUpdateQuery, getComponentType, handleMessageInternal, onInit, setKeysGenerated, setPreparedStatementSetter, setSqlParameterSourceFactory, setUsePayloadAsParameterSource
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConvention
Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, 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, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, 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 reactor.core.CoreSubscriber
currentContext
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
-
JdbcMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.Constructor takingDataSource
from which the DB Connection can be obtained and the select query to execute to retrieve new rows.- Parameters:
dataSource
- Must not be nullupdateSql
- query to execute
-
JdbcMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.Constructor takingJdbcOperations
instance to use for query execution and the select query to execute to retrieve new rows.- Parameters:
jdbcOperations
- instance to use for query executionupdateSql
- query to execute
-
JdbcMessageHandler