public class JdbcMessageReceiver
extends org.mule.transport.TransactedPollingMessageReceiver
TransactedPollingMessageReceiver reading data from a database.
Provides a way to acknowledge each read data using a SQL statement.| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
ackParams |
protected String |
ackStmt |
protected JdbcConnector |
connector |
protected List<String> |
readParams |
protected String |
readStmt |
static String |
RECEIVE_MESSAGE_IN_TRANSCTION |
static String |
RECEIVE_MESSAGES_IN_XA_TRANSCTION |
boolean |
receiveMessagesInXaTransaction |
DEFAULT_POLL_FREQUENCY, DEFAULT_POLL_TIMEUNIT, DEFAULT_STARTUP_DELAY, schedulesdefaultInboundTransformers, defaultResponseTransformers, flowConstruct, listener, receiverKey, replyToHandler| Constructor and Description |
|---|
JdbcMessageReceiver(org.mule.api.transport.Connector connector,
org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint,
String readStmt,
String ackStmt) |
| Modifier and Type | Method and Description |
|---|---|
protected List<org.mule.api.MuleMessage> |
createMuleMessages(List<Object> records)
Creates a mule message per each data record.
|
protected void |
doConnect() |
protected void |
doDisconnect() |
protected void |
doDispose() |
protected int |
executeAckStatement(Connection con,
org.mule.api.MuleMessage muleMessage)
Executes the acknowledge SQL statement for a given message.
|
protected int[] |
executeBatchAckStatement(Connection con,
List<org.mule.api.MuleMessage> messages)
Executes the acknowledge SQL statement for a list of messages.
|
protected List |
executeReadStatement(Connection con)
Executes the read SQL statement to get data from the database.
|
List |
getMessages() |
protected boolean |
hasAckStatement() |
protected void |
parseStatements(String readStmt,
String ackStmt)
Parses the read and acknowledge SQL statements
|
void |
processMessage(Object message) |
doStart, hasNoMessages, isReceiveMessagesInTransaction, isUseMultipleTransactedReceivers, poll, setReceiveMessagesInTransaction, setUseMultipleTransactedReceiverscreateWork, disableNativeScheduling, doStop, getBatchSize, getFrequency, getTimeUnit, performPoll, pollOnPrimaryInstanceOnly, schedule, setFrequency, setTimeUnit, unscheduleapplyInboundTransformers, applyResponseTransformers, connectHandler, createExecutionTemplate, createLifecycleManager, createMuleEvent, doStartHandler, getConnectEventId, getConnectionDescription, getEndpoint, getEndpointURI, getFlowConstruct, getReceiverKey, getReplyToHandler, getWorkManager, handleUnacceptedFilter, initialise, processMessage, propagateRootMessageIdProperty, routeEvent, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, setEndpoint, setListener, setReceiverKey, shouldConsumeInEveryNode, toString, warnIfMuleClientSendUsedactivate, connect, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doInitialise, getConnectEventId, getConnector, getLifecycleState, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, validate, validateConnectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateMuleMessage, createMuleMessagepublic static final String RECEIVE_MESSAGE_IN_TRANSCTION
public static final String RECEIVE_MESSAGES_IN_XA_TRANSCTION
protected JdbcConnector connector
protected String readStmt
protected String ackStmt
public boolean receiveMessagesInXaTransaction
public JdbcMessageReceiver(org.mule.api.transport.Connector connector,
org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint,
String readStmt,
String ackStmt)
throws org.mule.api.lifecycle.CreateException
org.mule.api.lifecycle.CreateExceptionprotected void parseStatements(String readStmt, String ackStmt)
protected void doDispose()
doDispose in class org.mule.transport.AbstractMessageReceiverprotected void doConnect()
throws Exception
doConnect in class org.mule.transport.AbstractTransportMessageHandlerExceptionprotected void doDisconnect()
throws Exception
doDisconnect in class org.mule.transport.AbstractTransportMessageHandlerExceptionpublic void processMessage(Object message) throws Exception
processMessage in class org.mule.transport.TransactedPollingMessageReceiverExceptionprotected boolean hasAckStatement()
protected List<org.mule.api.MuleMessage> createMuleMessages(List<Object> records)
records - data records used to created the payload of the new messages.protected int executeAckStatement(Connection con, org.mule.api.MuleMessage muleMessage) throws Exception
con - database connection to execute the statementmuleMessage - message to been acknowledgeExceptionprotected int[] executeBatchAckStatement(Connection con, List<org.mule.api.MuleMessage> messages) throws Exception
con - database connection to execute the statementmessages - messages to be acknowledgeExceptionpublic List getMessages() throws Exception
getMessages in class org.mule.transport.TransactedPollingMessageReceiverExceptionprotected List executeReadStatement(Connection con) throws Exception
con - database connection to execute the statementExceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.