Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

JMS Message Store persists messages in a JMS queue inside a JMS Broker. It can be configured by giving the class value as org.apache.synapse.message.store.impl.jms.JmsStore. Since they persist messages in a JMS queue in an ordered manner, JMS message stores can be used to implement a store-and-forward pattern that has quality-of-service parameters like guaranteed delivery and reliability.

...

  • JNDI Queue Name - JNDI Name of the Queue Name that message store is connecting
  • Connection factory - JNDI name of the Connection factory which is used to create jms connections
  • User Name - User Name that is used to create the connection with the broker
  • Password - Password that is used to create the connection with the broker
  • JMS API specification Version - 1.1 or 1.0 JMS API specification to be used (Default 1.1)
  • Enable Connection caching - true/false Enable Connection caching

...

Following is a sample JMS message store configuration that uses WSO2 MB as the message broker:

Code Block
languagexml
<messageStore name="JMSMS" class="org.apache.synapse.message.store.impl.jms.JmsStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
   <parameter name="java.naming.provider.url">repository/conf/jndi.properties</parameter>
   <parameter name="store.jms.destination">ordersQueue</parameter>
   <parameter name="store.jms.connection.factory">queue</parameter>
   <parameter name="store.jms.JMSSpecVersion">1.1</parameter>
</messageStore>

Following is a sample JMS message store configuration that uses ActiveMQ as the message broker:

Code Block
languagexml
<messageStore name="JMSMS" class="org.apache.synapse.message.store.impl.jms.JmsStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
   <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
   <parameter name="store.jms.destination">ordersQueue</parameter>
   <parameter name="store.jms.connection.factory">queue</parameter>
   <parameter name="store.jms.JMSSpecVersion">1.1</parameter>
</messageStore>
Info
titleNote

When configuring a JMS message store with WSO2 MB or Active MQ you need to copy the required client libraries to the <ESB_HOME>/repository/component/lib directory. If the relevant client libraries are not copied you will see a java.lang.ClassNotFoundException

For information on the client libraries you need to copy when configuring a JMS message store with WSO2 MB, see Configure with WSO2 Message Broker.

For information on the client libraries you need to copy when configuring a JMS message store with ActiveMQ, see Configure with ActiveMQ.

Individual message priorities can be set using the following property

...

on the provider. For example, the value can be 0-9 for ActiveMQ.

<property name="JMS_

...

PRIORITY" value="9" scope="axis2"/>

...

Also see  Store and Forward Using JMS Message Stores for information on configuring JMS message stores for a different message broker.

...

Note
titleNote

If you are using ActiveMQ 5.12.2 and above, you need to set the following system property on server start up for WSO2 ESB's JMS message store to work as expected.

Code Block
languagebash
-Dorg.apache.activemq.SERIALIZABLE_PACKAGES=“*"

With ActiveMQ 5.12.2 and above, you need to set the above property because users are enforced to explicitly whitelist packages that can be exchanged using ObjectMessages, and due to this restriction the message processor fails to read messages from ActiveMQ with the following error:

Code Block
languagebash
ERROR - JmsConsumer [JMS-C-1] cannot receive message from store. Error:Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class org.apache.synapse.message.store.impl.commons.StorableMessage! This class is not trusted to be serialized as ObjectMessage payload.

For information on configuring the JMS message store with different message brokers, see Store and Forward Using JMS Message Stores.

Excerpt
hiddentrue

Description of JMS Message Store.