-
1. Re: Adding properties to a received message
timfox Jul 18, 2007 6:42 AM (in response to joshiashutosh)Yes, this is a pain isn't it?
We have the JMS spec to blame for that.
Either of your two methods will work.
Actually we have exactly this problem in the message bridge where we have to forward a message from one source to a a target.
In that case we use method 2)
Take a look at the message bridge code for an example:
See http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_4_0_CR1/src/main/org/jboss/jms/server/bridge/Bridge.java
search for addMessageIDInHeader -
2. Re: Adding properties to a received message
joshiashutosh Jul 19, 2007 5:47 AM (in response to joshiashutosh)Thanks for the response, Tim.
I think I too will go with method 2.
I looked at the Bridge code and am myself using an identical one. One problem I am facing is that it gives an exception while setting the property JMSXDeliveryCount. It seems to be an internal property and Jboss Messaging doesn't allow adding it.
But in the Bridge code if such an exception occurs in setObjectProperty, and since the exception is not handled in the method, is it possible that some properties may not be added? -
3. Re: Adding properties to a received message
timfox Jul 19, 2007 7:09 AM (in response to joshiashutosh)"joshiashutosh" wrote:
Thanks for the response, Tim.
I think I too will go with method 2.
I looked at the Bridge code and am myself using an identical one. One problem I am facing is that it gives an exception while setting the property JMSXDeliveryCount. It seems to be an internal property and Jboss Messaging doesn't allow adding it.
But in the Bridge code if such an exception occurs in setObjectProperty, and since the exception is not handled in the method, is it possible that some properties may not be added?
That's strange, JMSDeliveryCout should be settable. Are you sure it's not the other JMS provider that's throwing the exception?
Anyway, I have changed the code slighly so it will only attempt to set JMSXGroupID and JMSXGroupSeq -
4. Re: Adding properties to a received message
joshiashutosh Jul 20, 2007 5:30 AM (in response to joshiashutosh)No. I am using only Jboss Messaging.
Thanks again for the help.