Hi Folks, Many JMS brokers/clients do not allow setting properties with the character '-' in the name, on JMS messages. For instance IBM Websphere MQ client library throws the following error if this is attempted:
javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: Content-Type at com.ibm.jms.JMSMessage.newMessageFormatException(JMSMessage.java:4772) at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:5771) at org.apache.synapse.transport.jms.JMSSender.createJMSMessage(JMSSender.java:424) at org.apache.synapse.transport.jms.JMSSender.sendMessage(JMSSender.java:207) at org.apache.synapse.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:120) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:190) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:174) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) In Synapse we set request headers as properties on the outgoing JMS message. If the request was received over HTTP, it will probably have a few headers with the '-' character (Content-Type, Transfer-Encoding etc). So this leads to the above error with certain JMS providers. What should be the correct fix for this? One option is to fix this in JMSSender and replace the '-' with something like '_' in property names. We can also probably fix this in Synapse layer by looking at EPR prefix (right now we workaround by removing such headers using some mediators). Thoughts? Thanks -- Hiranya Jayathilaka Senior Software Engineer; WSO2 Inc.; http://wso2.org E-mail: [email protected]; Mobile: +94 77 633 3491 Blog: http://techfeast-hiranya.blogspot.com
