public class JdbcOutboundGateway extends AbstractReplyProducingMessageHandler
AbstractReplyProducingMessageHandler.RequestHandler
IntegrationManagement.ManagementOverrides
messagingTemplate
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
JdbcOutboundGateway(DataSource dataSource,
String updateQuery) |
JdbcOutboundGateway(DataSource dataSource,
String updateQuery,
String selectQuery) |
JdbcOutboundGateway(JdbcOperations jdbcOperations,
String updateQuery) |
JdbcOutboundGateway(JdbcOperations jdbcOperations,
String updateQuery,
String selectQuery) |
Modifier and Type | Method and Description |
---|---|
protected void |
doInit() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
void |
setKeysGenerated(boolean keysGenerated)
Flag to indicate that the update query is an insert with auto-generated keys,
which will be logged at debug level.
|
void |
setMaxRows(Integer maxRows)
The maximum number of rows to query.
|
void |
setReplySqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) |
void |
setRequestPreparedStatementSetter(MessagePreparedStatementSetter requestPreparedStatementSetter) |
void |
setRequestSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) |
void |
setRowMapper(RowMapper<?> rowMapper) |
doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReply
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeaders
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public JdbcOutboundGateway(DataSource dataSource, String updateQuery)
public JdbcOutboundGateway(DataSource dataSource, String updateQuery, String selectQuery)
public JdbcOutboundGateway(JdbcOperations jdbcOperations, String updateQuery)
public JdbcOutboundGateway(JdbcOperations jdbcOperations, String updateQuery, String selectQuery)
public void setMaxRows(Integer maxRows)
JdbcPollingChannelAdapter
.
Also used to check before producing reply:
if result has only one item and maxRows
is not set or configured to 1
,
only that item is returned. Otherwise the whole list.
If not specified this value will default to 1
.
This parameter is only applicable if a selectQuery was provided. Null values
are not permitted.maxRows
- the number of rows to select. Must not be null.JdbcPollingChannelAdapter.setMaxRows(int)
public void setKeysGenerated(boolean keysGenerated)
keysGenerated
- the flag value to setpublic void setRequestSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
public void setRequestPreparedStatementSetter(MessagePreparedStatementSetter requestPreparedStatementSetter)
public void setReplySqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
public void setRowMapper(RowMapper<?> rowMapper)
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessageHandlerSupport
protected void doInit()
doInit
in class AbstractReplyProducingMessageHandler
protected Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandler
handleRequestMessage
in class AbstractReplyProducingMessageHandler
requestMessage
- The request message.null
.