Class ResequenceMessageStore
- java.lang.Object
-
- org.apache.synapse.message.store.AbstractMessageStore
-
- org.apache.synapse.message.store.impl.jdbc.JDBCMessageStore
-
- org.apache.synapse.message.store.impl.resequencer.ResequenceMessageStore
-
- All Implemented Interfaces:
ManagedLifecycle
,MessageStore
,Nameable
,SynapseArtifact
public class ResequenceMessageStore extends JDBCMessageStore
This represents the store which will allow to re-sequence messages.
- See Also:
JDBCMessageStore
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.message.store.impl.jdbc.JDBCMessageStore
MESSAGE_COLUMN_NAME
-
Fields inherited from class org.apache.synapse.message.store.AbstractMessageStore
description, fileName, lock, messageStoreMBean, messageStoreObservers, name, parameterKeyMap, parameters, sequence, synapseConfiguration, synapseEnvironment
-
-
Constructor Summary
Constructors Constructor Description ResequenceMessageStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 StoreMessageContext
peek()
Select and return the first element in current tableprotected List<Statement>
removeMessageStatement(String msgId)
Remove message statement.void
setParameters(Map<String,Object> parameters)
Set JDBC store parameters-
Methods inherited from class org.apache.synapse.message.store.impl.jdbc.JDBCMessageStore
clear, deserializeMessage, destroy, get, get, getAll, getConsumer, getJdbcConfiguration, getProcessedRows, getProducer, messageContentResultSet, remove, remove, serialize, size, store
-
Methods inherited from class org.apache.synapse.message.store.AbstractMessageStore
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
-
-
-
-
Method Detail
-
setParameters
public void setParameters(Map<String,Object> parameters)
Set JDBC store parameters- Specified by:
setParameters
in interfaceMessageStore
- Overrides:
setParameters
in classJDBCMessageStore
- Parameters:
parameters
- - List of parameters to set
-
init
public void init(SynapseEnvironment synapseEnvironment)
Initializes the JDBC Message Store- Specified by:
init
in interfaceManagedLifecycle
- Overrides:
init
in classJDBCMessageStore
- Parameters:
synapseEnvironment
- SynapseEnvironment for the store
-
removeMessageStatement
protected 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.
- Overrides:
removeMessageStatement
in classJDBCMessageStore
- Parameters:
msgId
- message id of the statement which should be removed.- Returns:
- the sql remove message statement.
-
getStoreMessageStatement
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.
- Overrides:
getStoreMessageStatement
in classJDBCMessageStore
- Parameters:
context
- the content of the message.sequenceId
- the sequence id of the message (optional).- Returns:
- SQL statement for insertion of value to store.
- Throws:
StoreException
- at an event there's an exception when generating the statement.- See Also:
ResequenceMessageStore
-
peek
public MessageContext peek() throws SynapseException
Select and return the first element in current table- Overrides:
peek
in classJDBCMessageStore
- Returns:
- - Select and return the first element from the table
- Throws:
SynapseException
-
-