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 StringAMQ_PREFIXstatic intDEFAULT_RETRY_COUNTstatic intDEFAULT_RETRY_INTERVALstatic StringEXCHANGE_NAMEstatic StringHOST_NAMEstatic StringHOST_PORTstatic StringPASSWORDstatic StringPUBLISHER_CONFIRMSstatic StringQUEUE_NAMEstatic StringRETRY_COUNTstatic StringRETRY_INTERVALstatic StringROUTING_KEYstatic StringSSL_ENABLEDstatic StringSSL_KEYSTORE_LOCATIONstatic StringSSL_KEYSTORE_PASSWORDstatic StringSSL_KEYSTORE_TYPEstatic StringSSL_TRUSTSTORE_LOCATIONstatic StringSSL_TRUSTSTORE_PASSWORDstatic StringSSL_TRUSTSTORE_TYPEstatic StringSSL_VERSIONstatic StringUSERNAMEstatic StringVIRTUAL_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 voidclear()Delete all the Messages in the Message Storecom.rabbitmq.client.ChannelcreateChannel(com.rabbitmq.client.Connection connection)Create a RabbitMQ channel from given connectioncom.rabbitmq.client.ConnectioncreateConnection()Create a RabbitMQ connectionvoiddestroy()This method should implement the destroying of the implemented parts of the configuration.MessageContextget(int index)Return the Message in given index position (this may depend on the implementation)MessageContextget(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 queueMessageConsumergetConsumer()Create a newRabbitMQConsumerobjectMessageProducergetProducer()Create a newRabbitMQProducerobjectintgetType()Returns the type of this message store.voidinit(SynapseEnvironment se)This method should implement the initialization of the implemented parts of the configuration.org.apache.axis2.context.MessageContextnewAxis2Mc()MessageContextnewSynapseMc(org.apache.axis2.context.MessageContext msgCtx)MessageContextremove()Retrieves and removes the first Message in this store.MessageContextremove(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:ManagedLifecycleThis method should implement the initialization of the implemented parts of the configuration.- Specified by:
initin interfaceManagedLifecycle- Overrides:
initin classAbstractMessageStore- Parameters:
se- SynapseEnvironment to be used for initialization
-
createConnection
public com.rabbitmq.client.Connection createConnection()
Create a RabbitMQ connection- Returns:
- a
Connectionobject
-
createChannel
public com.rabbitmq.client.Channel createChannel(com.rabbitmq.client.Connection connection)
Create a RabbitMQ channel from given connection- Parameters:
connection- aConnectionobject- Returns:
- a
Channelobject
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycleThis method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroyin interfaceManagedLifecycle- Overrides:
destroyin classAbstractMessageStore
-
getProducer
public MessageProducer getProducer()
Create a newRabbitMQProducerobject- Returns:
- a message producer
-
getConsumer
public MessageConsumer getConsumer()
Create a newRabbitMQConsumerobject- 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:MessageStoreRetrieves 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:MessageStoreDelete all the Messages in the Message Store
-
getType
public int getType()
Description copied from interface:MessageStoreReturns 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:
getTypein interfaceMessageStore- Overrides:
getTypein classAbstractMessageStore- Returns:
- Type of the message store.
-
remove
public MessageContext remove(String messageID)
Description copied from interface:MessageStoreDelete 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:MessageStoreReturn 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:MessageStoreGet 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:MessageStoreGet the Message with the given ID from the Message store without removing it- Parameters:
messageId- A message ID string- Returns:
- Message with given ID
-
-