On Sat, Jan 29, 2011 at 12:09 PM, Hiranya Jayathilaka <[email protected]>wrote:
> Hi Amila, > > On Sat, Jan 29, 2011 at 11:45 AM, Amila Suriarachchi < > [email protected]> wrote: > >> if those properties are not meaning full in JMS then the correct way is to >> remove from the synapse layer. Synapse does the jms transport sender >> invocation. So it should not send any unrelated stuff. >> > > Synapse does not distinguish between different transports. It's a generic > mediation layer which interacts with all the transports the same way. So I > don't think special casing JMS invocations is a very good solution for > Synapse. Also it's not Synapse which invokes the sender. It's the underlying > Axis2 engine (see the stack trace). > I did not intended to put that to synapse code. When some one writes a synapse configuration he knows he is going to invoke a jms transport. So he can remove those headers in his synapse configuration. Synapse In sequence (or send mediator) initiates the message sending part. > > It seems it's wrong to have '-' in JMS property names according to the > specs and that's why many brokers don't allow that. > If '- 'is not allowed in JMS, even JMS transport should throw an exception. JMS transport should not try to make invalid headers to valid formats. These invalid headers are given by the synapse configuration. so it has to remove them. thanks, Amila. > However some brokers (eg: ActiveMQ) are more flexible in this area. So I > think this is something we should fix in the JMS transport level once and > for all. WDYT? > > Thanks, > Hiranya > > >> >> thanks, >> Amila. >> >> >> On Fri, Jan 28, 2011 at 10:18 AM, Hiranya Jayathilaka < >> [email protected]> wrote: >> >>> 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 >>> >> >> >> >> -- >> Amila Suriarachchi >> WSO2 Inc. >> blog: http://amilachinthaka.blogspot.com/ >> > > > > -- > 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 > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
