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

All docs This doc

Versions Compared


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


Code Block
ERROR JMSSender Error creating a JMS message from the axis message context
javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: Content-Type

This exception is specific to the JMS broker used, and is thrown by the JMS client libraries used to connect with the JMS broker.
The incoming HTTP message contains a bunch of HTTP headers that have the ‘-‘ character. Some noticeable examples are Content-length and Transfer-encoding headers. When WSO2 ESB forwards a message over JMS, it sets the headers of the incoming message to the outgoing JMS message as JMS properties. But, according to the JMS specification, the ‘-‘ character is prohibited in JMS property names. Some JMS brokers like ActiveMQ do not check this specifically, in which case there will not be any issues. But some brokers do and they throw exceptions. 


If your topic or queue name has contains the termination characters ":" or "=", JMSUtils will not be able to find the topic/queue and will give you the warning "JMSUtils cannot locate destination". (For more information, see 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:


To avoid this issue, you can create a key-value pair in the file that maps the topic/queue name to a key without that either escapes these characters with a backslash (\) or does not contain ":" or "=". For example:\:\:topic = my::topic


topic.myTopic = my::topic

You can then use this key in the proxy service as follows:

<address uri="jms:/myTopicmy\:\:topic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=repository/conf/;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:/myTopicmy\:\:topic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;topic.myTopicmy\:\:topic=my::topic&amp;java.naming.provider.url=repository/conf/;transport.jms.DestinationType=topic"/>