public class RabbitMQStore extends AbstractMessageStore
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
RabbitMQ Server default port
|
static java.lang.String |
EXCHANGE_NAME
RabbitMQ exchange.
|
static java.lang.String |
HOST_NAME
RabbitMQ Server Host name
|
static java.lang.String |
HOST_PORT
RabbitMQ Server Port
|
static java.lang.String |
PASSWORD
RabbitMQ Broker password
|
static java.lang.String |
QUEUE_NAME
RabbitMQ queue name that this message store must store the messages to.
|
static java.lang.String |
ROUTE_KEY
RabbitMQ route key which queue is binded
|
static java.lang.String |
SSL_ENABLED |
static java.lang.String |
SSL_KEYSTORE_LOCATION |
static java.lang.String |
SSL_KEYSTORE_PASSWORD |
static java.lang.String |
SSL_KEYSTORE_TYPE |
static java.lang.String |
SSL_TRUSTSTORE_LOCATION |
static java.lang.String |
SSL_TRUSTSTORE_PASSWORD |
static java.lang.String |
SSL_TRUSTSTORE_TYPE |
static java.lang.String |
SSL_VERSION |
static java.lang.String |
USERNAME
RabbitMQ Broker username
|
static java.lang.String |
VIRTUAL_HOST
RabbitMQ Server Virtual Host
|
description, fileName, lock, messageStoreMBean, messageStoreObservers, name, parameterKeyMap, parameters, sequence, synapseConfiguration, synapseEnvironment
Constructor and Description |
---|
RabbitMQStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
cleanup(com.rabbitmq.client.Connection connection,
boolean error)
Cleans up the RabbitMQ Connection
|
void |
clear()
Delete all the Messages in the Message Store
|
boolean |
closeConnection(com.rabbitmq.client.Connection connection)
Close any given connection
|
boolean |
closeProducerConnection()
Closes the existing RabbitMQ message producer connection.
|
void |
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(java.lang.String messageId)
Get the Message with the given ID from the Message store without removing it
|
java.util.List<MessageContext> |
getAll()
Get the All messages in the Message store without removing them from the queue
|
MessageConsumer |
getConsumer()
Returns a Message Consumer for this message store.
|
MessageProducer |
getProducer()
Returns a Message Producer for this message store.
|
int |
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() |
boolean |
newProducerConnection()
Create a new message producer connection, if there is an existing connection close it and
create a new connection
|
MessageContext |
newSynapseMc(org.apache.axis2.context.MessageContext msgCtx) |
com.rabbitmq.client.Connection |
producerConnection() |
MessageContext |
remove()
Retrieves and removes the first Message in this store.
|
MessageContext |
remove(java.lang.String messageID)
Delete and return the MessageContext with given Message id
|
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
public static final java.lang.String USERNAME
public static final java.lang.String PASSWORD
public static final java.lang.String HOST_NAME
public static final java.lang.String HOST_PORT
public static final int DEFAULT_PORT
public static final java.lang.String VIRTUAL_HOST
public static final java.lang.String QUEUE_NAME
public static final java.lang.String ROUTE_KEY
public static final java.lang.String EXCHANGE_NAME
public static final java.lang.String SSL_ENABLED
public static final java.lang.String SSL_KEYSTORE_LOCATION
public static final java.lang.String SSL_KEYSTORE_TYPE
public static final java.lang.String SSL_KEYSTORE_PASSWORD
public static final java.lang.String SSL_TRUSTSTORE_LOCATION
public static final java.lang.String SSL_TRUSTSTORE_TYPE
public static final java.lang.String SSL_TRUSTSTORE_PASSWORD
public static final java.lang.String SSL_VERSION
public void init(SynapseEnvironment se)
ManagedLifecycle
init
in interface ManagedLifecycle
init
in class AbstractMessageStore
se
- SynapseEnvironment to be used for initializationpublic boolean newProducerConnection()
public void destroy()
ManagedLifecycle
destroy
in interface ManagedLifecycle
destroy
in class AbstractMessageStore
public boolean closeConnection(com.rabbitmq.client.Connection connection)
connection
- public boolean closeProducerConnection()
public MessageProducer getProducer()
MessageStore
public MessageConsumer getConsumer()
MessageStore
public org.apache.axis2.context.MessageContext newAxis2Mc()
public MessageContext newSynapseMc(org.apache.axis2.context.MessageContext msgCtx)
public com.rabbitmq.client.Connection producerConnection()
public MessageContext remove() throws java.util.NoSuchElementException
MessageStore
java.util.NoSuchElementException
- if store is emptypublic void clear()
MessageStore
public int getType()
MessageStore
Constants.JMS_MS
, Constants.INMEMORY_MS
,
or Constants.JDBC_MS
getType
in interface MessageStore
getType
in class AbstractMessageStore
public MessageContext remove(java.lang.String messageID)
MessageStore
messageID
- message id of the Messagepublic MessageContext get(int index)
MessageStore
index
- position of the messagepublic java.util.List<MessageContext> getAll()
MessageStore
public MessageContext get(java.lang.String messageId)
MessageStore
messageId
- A message ID stringpublic boolean cleanup(com.rabbitmq.client.Connection connection, boolean error)
connection
- RabbitMQ Connectionerror
- is this method called upon an errortrue
if the cleanup is successful. false
otherwise.Copyright © 2005-2020 Apache Software Foundation. All Rights Reserved.