Class RabbitMQStore
- java.lang.Object
-
- org.apache.synapse.message.store.AbstractMessageStore
-
- org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore
-
- All Implemented Interfaces:
ManagedLifecycle
,MessageStore
,Nameable
,SynapseArtifact
public class RabbitMQStore extends AbstractMessageStore
The message store and message processor implementation for the RabbitMQ
-
-
Field Summary
Fields Modifier and Type Field Description static String
AMQ_PREFIX
static int
DEFAULT_RETRY_COUNT
static int
DEFAULT_RETRY_INTERVAL
static String
EXCHANGE_NAME
static String
HOST_NAME
static String
HOST_PORT
static String
PASSWORD
static String
PUBLISHER_CONFIRMS
static String
QUEUE_NAME
static String
RETRY_COUNT
static String
RETRY_INTERVAL
static String
ROUTING_KEY
static String
SSL_ENABLED
static String
SSL_KEYSTORE_LOCATION
static String
SSL_KEYSTORE_PASSWORD
static String
SSL_KEYSTORE_TYPE
static String
SSL_TRUSTSTORE_LOCATION
static String
SSL_TRUSTSTORE_PASSWORD
static String
SSL_TRUSTSTORE_TYPE
static String
SSL_VERSION
static String
USERNAME
static String
VIRTUAL_HOST
-
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 RabbitMQStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Delete all the Messages in the Message Storecom.rabbitmq.client.Channel
createChannel(com.rabbitmq.client.Connection connection)
Create a RabbitMQ channel from given connectioncom.rabbitmq.client.Connection
createConnection()
Create a RabbitMQ connectionvoid
destroy()
This method should implement the destroying of the implemented parts of the configuration.MessageContext
get(int index)
Return the Message in given index position (this may depend on the implementation)MessageContext
get(String messageId)
Get the Message with the given ID from the Message store without removing itList<MessageContext>
getAll()
Get the All messages in the Message store without removing them from the queueMessageConsumer
getConsumer()
Create a newRabbitMQConsumer
objectMessageProducer
getProducer()
Create a newRabbitMQProducer
objectint
getType()
Returns the type of this message store.void
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration.org.apache.axis2.context.MessageContext
newAxis2Mc()
MessageContext
newSynapseMc(org.apache.axis2.context.MessageContext msgCtx)
MessageContext
remove()
Retrieves and removes the first Message in this store.MessageContext
remove(String messageID)
Delete and return the MessageContext with given Message id-
Methods inherited from class org.apache.synapse.message.store.AbstractMessageStore
addParameter, addParameterKey, dequeued, difference, enqueued, getArtifactContainerName, getDescription, getFileName, getLock, getName, getParameterKey, getParameterKeyMap, getParameters, isEdited, nextConsumerId, nextProducerId, notifyMessageAddition, notifyMessageRemoval, registerObserver, setArtifactContainerName, setDescription, setFileName, setIsEdited, setName, setParameters, size, unregisterObserver
-
-
-
-
Field Detail
-
USERNAME
public static final String USERNAME
- See Also:
- Constant Field Values
-
PASSWORD
public static final String PASSWORD
- See Also:
- Constant Field Values
-
HOST_NAME
public static final String HOST_NAME
- See Also:
- Constant Field Values
-
HOST_PORT
public static final String HOST_PORT
- See Also:
- Constant Field Values
-
VIRTUAL_HOST
public static final String VIRTUAL_HOST
- See Also:
- Constant Field Values
-
QUEUE_NAME
public static final String QUEUE_NAME
- See Also:
- Constant Field Values
-
ROUTING_KEY
public static final String ROUTING_KEY
- See Also:
- Constant Field Values
-
EXCHANGE_NAME
public static final String EXCHANGE_NAME
- See Also:
- Constant Field Values
-
RETRY_INTERVAL
public static final String RETRY_INTERVAL
- See Also:
- Constant Field Values
-
RETRY_COUNT
public static final String RETRY_COUNT
- See Also:
- Constant Field Values
-
PUBLISHER_CONFIRMS
public static final String PUBLISHER_CONFIRMS
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_INTERVAL
public static final int DEFAULT_RETRY_INTERVAL
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_COUNT
public static final int DEFAULT_RETRY_COUNT
- See Also:
- Constant Field Values
-
SSL_ENABLED
public static final String SSL_ENABLED
- See Also:
- Constant Field Values
-
SSL_KEYSTORE_LOCATION
public static final String SSL_KEYSTORE_LOCATION
- See Also:
- Constant Field Values
-
SSL_KEYSTORE_TYPE
public static final String SSL_KEYSTORE_TYPE
- See Also:
- Constant Field Values
-
SSL_KEYSTORE_PASSWORD
public static final String SSL_KEYSTORE_PASSWORD
- See Also:
- Constant Field Values
-
SSL_TRUSTSTORE_LOCATION
public static final String SSL_TRUSTSTORE_LOCATION
- See Also:
- Constant Field Values
-
SSL_TRUSTSTORE_TYPE
public static final String SSL_TRUSTSTORE_TYPE
- See Also:
- Constant Field Values
-
SSL_TRUSTSTORE_PASSWORD
public static final String SSL_TRUSTSTORE_PASSWORD
- See Also:
- Constant Field Values
-
SSL_VERSION
public static final String SSL_VERSION
- See Also:
- Constant Field Values
-
AMQ_PREFIX
public static final String AMQ_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(SynapseEnvironment se)
Description copied from interface:ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.- Specified by:
init
in interfaceManagedLifecycle
- Overrides:
init
in classAbstractMessageStore
- Parameters:
se
- SynapseEnvironment to be used for initialization
-
createConnection
public com.rabbitmq.client.Connection createConnection()
Create a RabbitMQ connection- Returns:
- a
Connection
object
-
createChannel
public com.rabbitmq.client.Channel createChannel(com.rabbitmq.client.Connection connection)
Create a RabbitMQ channel from given connection- Parameters:
connection
- aConnection
object- Returns:
- a
Channel
object
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
- Overrides:
destroy
in classAbstractMessageStore
-
getProducer
public MessageProducer getProducer()
Create a newRabbitMQProducer
object- Returns:
- a message producer
-
getConsumer
public MessageConsumer getConsumer()
Create a newRabbitMQConsumer
object- Returns:
- a message consumer
-
newAxis2Mc
public org.apache.axis2.context.MessageContext newAxis2Mc()
-
newSynapseMc
public MessageContext newSynapseMc(org.apache.axis2.context.MessageContext msgCtx)
-
remove
public MessageContext remove() throws NoSuchElementException
Description copied from interface:MessageStore
Retrieves and removes the first Message in this store. Message ordering will depend on the underlying implementation- Returns:
- first message context in the store
- Throws:
NoSuchElementException
- if store is empty
-
clear
public void clear()
Description copied from interface:MessageStore
Delete all the Messages in the Message Store
-
getType
public int getType()
Description copied from interface:MessageStore
Returns the type of this message store.
The type of a message store can be one of following types,
Constants.JMS_MS
,Constants.INMEMORY_MS
, orConstants.JDBC_MS
- Specified by:
getType
in interfaceMessageStore
- Overrides:
getType
in classAbstractMessageStore
- Returns:
- Type of the message store.
-
remove
public MessageContext remove(String messageID)
Description copied from interface:MessageStore
Delete and return the MessageContext with given Message id- Parameters:
messageID
- message id of the Message- Returns:
- MessageContext instance
-
get
public MessageContext get(int index)
Description copied from interface:MessageStore
Return the Message in given index position (this may depend on the implementation)- Parameters:
index
- position of the message- Returns:
- Message in given index position
-
getAll
public List<MessageContext> getAll()
Description copied from interface:MessageStore
Get the All messages in the Message store without removing them from the queue- Returns:
- List of all Messages
-
get
public MessageContext get(String messageId)
Description copied from interface:MessageStore
Get the Message with the given ID from the Message store without removing it- Parameters:
messageId
- A message ID string- Returns:
- Message with given ID
-
-