stompgem / stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
http://stomp.github.com
Apache License 2.0
152 stars 80 forks source link

Add suppress_content_type header support, set this to supress content… #135

Closed rhadoo closed 7 years ago

rhadoo commented 7 years ago

Add suppress_content_type header support, set this to supress content_type header. This header breaks mdb processing on glassfish

gmallard commented 7 years ago

I do not have a problem with this, I have considered it myself.

So I will take this PR.

But first, please tell me / document specifically what breaks. So we have that information available for others.

rhadoo commented 7 years ago

In our case we are using stomp client connecting to activemq to post a message, and a glassfish mdb pulls the message, clones it and puts in on a openmq jms queue. The error in logs is: javax.jms.JMSException: [C4043]: Illegal character '-' used in property name content-type at com.sun.messaging.jmq.jmsclient.MessageImpl.checkValidPropertyName(MessageImpl.java:769) at com.sun.messaging.jmq.jmsclient.MessageImpl.checkAndSetProperty(MessageImpl.java:832) My assumption is that this happens because glassfish doesn't seem to validate the header containing "-",content-length being already supressed when transforming stomp>jms, and would occur also when using stomp directly on openmq or other mq implementations, as they would also forward the header. i have found some other reports, for weblogic, so more applications servers could have this issue: http://activemq.2283324.n4.nabble.com/ruby-client-stompconnect-weblogic-9-2-issue-td2398413.html

gmallard commented 7 years ago

Great, thanks for that documentation. And thanks again for the PR. You will show on the contributors list the when the next gem release happens.

For the record, I test against:

I have long been aware of Open MQ, but I do not test this gem against it at all. I have enough hassles with WMQ at work, and I do not need to duplicate that.

I run interoperability tests (STOMP <-> JMS) with both ActiveMQ and Artemis.

I am surprised there might be problems with a '-'. Because of headers like 'message-id'.

And ..... I would have thought that an MDB was overkill for what you describe. But maybe not ....

And last: if you or any one else needs a STOMP client library that is go based, please check out:

https://github.com/gmallard/stompngo