This documentation is for WSO2 Enterprise Service Bus version 4.9.0 . View documentation for the latest release.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changes related to DOCUMENTATION-4858

...

The configuration above only includes the mandatory parameters. For some brokers you may have to specify additional parameters. See the following table for the list of configurable parameters:

Parameter NameValueRequired
java.naming.factory.initial Initial Context Factory used to connect to the JMS broker.YES
java.naming.provider.urlUrl of the naming provider to be used by the context factory.YES
store.jms.destinationJNDI Name of the Queue Name that the message store is connecting to.
NO but for some JMS clients this will be needed
store.jms.connection.factoryJNDI name of the Connection factory, which is used to create jms connections.NO but for some JMS clients this will be needed
store.jms.usernameUser Name that is used to create the connection with the broker.NO
store.jms.passwordPassword that is used to create the connection with the broker.NO
store.jms.JMSSpecVersion1.1 or 1.0 JMS API specification to be used (Default 1.1)NO
store.jms.cache.connectiontrue/false Enable Connection cachingNO

Next, let's see a few real-life business use cases of JMS message stores. 

Table of Contents
maxLevel3
minLevel3

...

  1. Define an endpoint that can be used to send the message to the back-end service.

    Code Block
    languagehtml/xml
    <endpoint name="SimpleStockQuoteService">
       <address uri="http://127.0.0.1:9000/services/SimpleStockQuoteService"/>
    </endpoint>
  2. Create a proxy service that stores messages in the message store you created.

    Code Block
    languagehtml/xml
    <proxy name="Proxy2" transports="https,http"
           statistics="disable" trace="disable" startOnLoad="true">
       <target>
          <inSequence>
             <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" />
             <log level="full" />
             <store messageStore="JMSMS" />
          </inSequence>
       </target>
    </proxy>
  3. Create a sequence to handle the response you receive from the back-end service.

    Code Block
    languagehtml/xml
    <sequence name="replySequence">
      <log level="full">
         <property name="REPLY" value="MESSAGE" />
      </log>
      <drop/>
    </sequence>
  4. Use the following configuration to create a message forwarding processor that consumes the messages stored in the message store. When compared to the message processor in use case scenario 1 , this has an additional parameter message.processor.reply.sequence that points to a sequence to handle the response message.

    Code Block
    languagehtml/xml
    <messageProcessor name="Processor2" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" nametargetEndpoint="Processor2SimpleStockQuoteService" messageStore="JMSMS" xmlns="http://ws.apache.org/ns/synapse">
       <parameter name="interval">1000</parameter>
       <parameter name="client.retry.interval">4000<>1000</parameter>
        <parameter name="max.delivery.attempts">4</parameter>
        <parameter name="message.processor.reply.sequence">replySequence</parameter>
       <parameter name="is.active">true</parameter>
       <parameter name="max.delivery.drop">Disabled</parameter>
       <parameter name="member.count">1</parameter>
    </messageProcessor>

Once the back-end service and the ESB are configured, you can execute the sample.    

...