Package org.apache.axis2.transport.jms

Transport implementation for JMS.

JMS Listener Configuration (axis2.xml)

e.g:
    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
        <parameter name="myTopicConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType">topic</parameter>
            <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType">queue</parameter>
            <parameter name="transport.jms.JMSSpecVersion">1.1</parameter>
        </parameter>

        <parameter name="default">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">ConnectionFactory</parameter>
        </parameter>
    </transportReceiver>

    <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender">
        <parameter name="myTopicConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
            <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
            <parameter name="transport.jms.CacheLevel">producer</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
            <parameter name="transport.jms.CacheLevel">producer</parameter>
        </parameter>

        <parameter name="default">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">ConnectionFactory</parameter>
            <parameter name="transport.jms.CacheLevel">connection</parameter>
        </parameter>
    </transportSender>

The Transport Listener and Sender both allows the user to configure one or more logical JMS Connection Factories, which are named definitions as shown above. Any remaining parameters maybe defined at the service level via the services.xml. The applicable set of parameters for a service would be the union of the properties from the services.xml and the corresponding logical connection factory.

Transport level

Listening Sending
JNDI java.naming.factory.initial The JNDI InitialContext factory class Required

java.naming.provider.url JNDI Provider URL Required

java.naming.security.principal Username for JNDI access


java.naming.security.credentials Password for JNDI access

Transactions transport.Transactionality Desired transactionality. One of none / local / jta Defaults to none

transport.UserTxnJNDIName JNDI name to be used to obtain a UserTransaction Defaults to "java:comp/UserTransaction"

transport.CacheUserTxn Generally its safe and more efficient to cache the UserTransaction reference from JNDI. One of true/ false Defaults to true

transport.jms.SessionTransacted Should the JMS Session be transacted. One of true/ false Defaults to true when local transactions are used

transport.jms.SessionAcknowledgement JMS Session acknowledgement mode to be used. One of AUTO_ACKNOWLEDGE | CLIENT_ACKNOWLEDGE | DUPS_OK_ACKNOWLEDGE | SESSION_TRANSACTED Defaults to AUTO_ACKNOWLEDGE
Connection transport.jms.ConnectionFactory Name of the logical connection factory this service will use Defaults to "default"

transport.jms.ConnectionFactoryJNDIName The JNDI name of the JMS ConnectionFactory Required

transport.jms.ConnectionFactoryType Type of ConnectionFactory – queue / topic Suggested to be specified

transport.jms.JMSSpecVersion JMS API Version One of "1.1" or "1.0.2b" Defaults to 1.1

transport.jms.UserName The JMS connection username


transport.jms.Password The JMS connection password

Destinations transport.jms.Destination JNDI Name of the Destination Defaults to Service name

transport.jms.DestinationType Type of Destination – queue / topic Defaults to a queue

transport.jms.DefaultReplyDestination JNDI Name of the default reply Destination


transport.jms.DefaultReplyDestinationType Type of the reply Destination – queue / topic Same type as of Destination
Advanced transport.jms.MessageSelector Optional message selector to be applied


transport.jms.SubscriptionDurable Is the subscription durable? (For Topics) – true / false Defaults to false

transport.jms.DurableSubscriberName Name to be used for the durable subscription Required when subscription is durable

transport.jms.PubSubNoLocal Should messages published by the same connection (for Topics) be received? – true / false Defaults to false

transport.jms.CacheLevel The JMS resource cache level. One of none / connection / session / consumer / producer / auto Defaults to auto

transport.jms.ReceiveTimeout Time to wait for a JMS message during polling. Negative means wait forever, while 0 means do not wait at all. Anything else, is a millisecond value for the poll Defaults to 1000ms

transport.jms.ConcurrentConsumers Number of concurrent consumer tasks (~threads) to be started to poll for messages for this service. For Topics, this should be always 1, to prevent the same message being processed multiple times Defaults to 1

transport.jms.MaxConcurrentConsumers Will dynamically scale the number of concurrent consumer tasks (~threads) until this value; as the load increases. Should always be 1 for Topics. Defaults to 1

transport.jms.IdleTaskLimit The number of idle (i.e. poll without receipt of a message) runs per task, before it dies – to recycle resources, and to allow dynamic scale down. Defaults to 10

transport.jms.MaxMessagesPerTask The maximum number of successful message receipts to limit per Task lifetime. Defaults to –1 which implies unlimited messages
Reconnection transport.jms.InitialReconnectDuration Initial reconnection attempt duration Defaults to 10,000ms

transport.jms.ReconnectProgressFactor Factor used to compute consecutive reconnection attempt durations, in a geometric series Defaults to 2 (i.e. exponential)

transport.jms.MaxReconnectDuration Maximum limit for a reconnection duration Defaults to 1 hour

transport.jms.PublishEPR One or more JMS URL's to be showed as the JMS EPRs on the WSDL for the service. Allows the specification of a custom EPR, and/or hiding of internal properties from a public EPR (e.g. credentials). Add one as LEGACY to retain auto generated EPR, when adding new EPRs






Legacy Mode and Payload handling Wrapper Binary and Text payload wrapper element to be specified as "{ns}name" where ns refers to a namespace and name the name of the element Default binary wrapper
  • {http://ws.apache.org/commons/ns/payload}binary
Default text wrapper
  • {http://ws.apache.org/commons/ns/payload}text


Operation operation name to be specified as "{ns}name" where ns refers to the namespace and name the name of the operation Defaults to urn:mediate