An ESB can be used to implement different kind of messaging and integration patterns. To support these patters sometimes we need a storage to store messages.
Message Store is the storage for ESB messages.
For Example In a scenario where we have a back end service that can only accept messages at a given rate and incoming traffic to ESB will have different message rates. So to serve that traffic utilizing the backend services there should be a temporary storage for messages. Message Store can be used as this temporary storage.
Incoming message traffic can be stored using the store mediator. And Message processors associated with message store can be used to deliver messages to the backend services at a give rate.
Users can implement their own message store by implementing the MessageStore interface and plug them using the configuration.ESB ships two message store implementations.
<messageStore name="string" class="classname" > <parameter name="string" > "string" </parameter>* </messageStore>
Message Store is a top level ESB configuration element where it should have a unique name.
class attribute value is the fully qualified class name of the underlying message store implementation.
There can be many message store implementations.Users can write their own message store implementation and use it.
Parameters section is used to configure the parameters that is needed by underlying message store implementation
This is the default Message Store that will be created if user does not specify any implementation from the configuration. Messages will be stored in an In-memory queue.So in case of a ESB restart all the messages stored will be lost.
In Memory message store is lot more faster than any persistence message store implementations.
So it can be used as a temporary storage of messages for use cases such as implementation of high speed store and forwarded patterns where message persistence is not a requirement.
JMS Message Store can be configured using configuration by giving class value as org.wso2.carbon.message.store.persistence.jms.JMSMessageStore Messages will be stored in a configured JMS queue lying in a JMS Broker
Since this will persistent messages in a JMS queue in a ordered way. JMS message store can be used to implement store and forward patters that have QoS parameters like in order delivery and reliability
Configuration to connect to a broker is provided as parameter values
|java.naming.factory.initial||Initial Context Factory to use to connect to the JMS broker||YES|
|java.naming.provider.url||Url of the naming provider to be used by the context factory||YES|
|store.jms.destination||JNDI Name of the Queue Name that message store is connecting||NO but for some JMS clients this will be needed|
|store.jms.connection.factory||JNDI name of the Connection factory which is used to create jms connections||NO but for some JMS clients this will be needed|
|store.jms.username||User Name that is used to create the connection with the broker||NO|
|store.jms.password||Password that is used to create the connection with the broker||NO|
|store.jms.JMSSpecVersion||1.1 or 1.0 JMS API specification to be used (Default 1.1)||NO|
|store.jms.cache.connection||true/false Enable Connection caching||NO|