public class ResequenceMessageStore extends JDBCMessageStore
This represents the store which will allow to re-sequence messages.
JDBCMessageStore
MESSAGE_COLUMN_NAME
description, fileName, lock, messageStoreMBean, messageStoreObservers, name, parameterKeyMap, parameters, sequence, synapseConfiguration, synapseEnvironment
Constructor and Description |
---|
ResequenceMessageStore() |
Modifier and Type | Method and Description |
---|---|
protected Statement |
getStoreMessageStatement(MessageContext context,
Long sequenceId)
Stores message in database by providing the correct sequence id.
|
void |
init(SynapseEnvironment synapseEnvironment)
Initializes the JDBC Message Store
|
MessageContext |
peek()
Select and return the first element in current table
|
protected List<Statement> |
removeMessageStatement(String msgId)
Remove message statement.
|
void |
setParameters(Map<String,Object> parameters)
Set JDBC store parameters
|
clear, deserializeMessage, destroy, get, get, getAll, getConsumer, getJdbcConfiguration, getProcessedRows, getProducer, messageContentResultSet, remove, remove, serialize, size, store
addParameter, addParameterKey, dequeued, difference, enqueued, getArtifactContainerName, getDescription, getFileName, getLock, getName, getParameterKey, getParameterKeyMap, getParameters, getType, isEdited, nextConsumerId, nextProducerId, notifyMessageAddition, notifyMessageRemoval, registerObserver, setArtifactContainerName, setDescription, setFileName, setIsEdited, setName, unregisterObserver
public void setParameters(Map<String,Object> parameters)
setParameters
in interface MessageStore
setParameters
in class JDBCMessageStore
parameters
- - List of parameters to setpublic void init(SynapseEnvironment synapseEnvironment)
init
in interface ManagedLifecycle
init
in class JDBCMessageStore
synapseEnvironment
- SynapseEnvironment for the storeprotected List<Statement> removeMessageStatement(String msgId)
Remove message statement.
When re-sequenced we need to maintain the last processed id along with the removal. So that at an event the node crashes we know where to start from.
Statement to remove the message once a response is received.
removeMessageStatement
in class JDBCMessageStore
msgId
- message id of the statement which should be removed.protected Statement getStoreMessageStatement(MessageContext context, Long sequenceId) throws StoreException
Stores message in database by providing the correct sequence id.
Generates the statement to store message in database.
If the sequence id is specified the corresponding sequence id will be stored, sequence id will be specified if re-sequence message store is being used. In other times this value will be null.
getStoreMessageStatement
in class JDBCMessageStore
context
- the content of the message.sequenceId
- the sequence id of the message (optional).StoreException
- at an event there's an exception when generating the statement.ResequenceMessageStore
public MessageContext peek() throws SynapseException
peek
in class JDBCMessageStore
SynapseException
Copyright © 2005–2020 Apache Software Foundation. All rights reserved.