This troubleshooting guide helps you resolve common problems encountered in JMS integration scenarios with WSO2 ESB.
...
If your topic or queue name has the characters ":" or "=", you must escape those characters with a backslash "\" in the jndi.properties
file. Otherwise, JMSUtils will not be able to find the topic/queue and will give you the warning "JMSUtils cannot locate destination". (For more information, see http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.Reader%29.) For example, if the topic name is my::topic
, the following configuration will not work, because the topic name will be parsed as my
instead of my::topic
:
<address uri="jms:/my::topic?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=topic"/>
To avoid this issue, you can create a key-value pair in the jndi.properties
file that maps the topic/queue name to a key without ":" or "=". For example:
topic.myTopic = my::topic
You can then use this key in the proxy service as follows:
<address uri="jms:/myTopic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=topic"/>
If you do not want to use the JNDI properties file, you can define the key-value pair right in the proxy configuration:
<address uri="jms:/myTopic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&topic.myTopic=my::topic&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=topic"/>