|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Spring, MQ Series and the use of Expiry |
« View previous topic :: View next topic » |
Author |
Message
|
bpcrue |
Posted: Sun Feb 03, 2008 11:46 am Post subject: Spring, MQ Series and the use of Expiry |
|
|
Newbie
Joined: 03 Feb 2008 Posts: 1
|
We are using Spring Framework, utilizing the JMS capabilities, and setting the JMS expiry on the messages. We are using IBM MQ 6.1 under the covers as our messaging software. The Expiry does not get set on the MQ Message correctly through the JMS setting, thus leaving the default of -1 (infinite) on the messages, clogging our queues with dead messages.
Is there a fix or workaround to be able to keep our JMS interface through Spring and be able to set the expiry on each message?
Thanks for your help. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Feb 03, 2008 4:09 pm Post subject: Re: Spring, MQ Series and the use of Expiry |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't think so.
6.0.x.x, maybe.
Presumably it's a configuration issue with your JMS definitions.
Or possibly with the way you're trying to set it on the JMSMessage. This is less likely.
Hard to tell from what you've said, though. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Feb 03, 2008 5:21 pm Post subject: Re: Spring, MQ Series and the use of Expiry |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bpcrue wrote: |
We are using Spring Framework, utilizing the JMS capabilities, and setting the JMS expiry on the messages. We are using IBM MQ 6.1 under the covers as our messaging software. The Expiry does not get set on the MQ Message correctly through the JMS setting, thus leaving the default of -1 (infinite) on the messages, clogging our queues with dead messages.
Is there a fix or workaround to be able to keep our JMS interface through Spring and be able to set the expiry on each message?
Thanks for your help. |
Check out the JNDI layer. If it allows you to set a default expiration on the Destination you might just have found a bit of luck!  _________________ MQ & Broker admin |
|
Back to top |
|
 |
DanReidy |
Posted: Mon Feb 04, 2008 7:36 am Post subject: Re: Spring, MQ Series and the use of Expiry |
|
|
Newbie
Joined: 04 Feb 2008 Posts: 4
|
fjb_saper wrote: |
bpcrue wrote: |
We are using Spring Framework, utilizing the JMS capabilities, and setting the JMS expiry on the messages. We are using IBM MQ 6.1 under the covers as our messaging software. The Expiry does not get set on the MQ Message correctly through the JMS setting, thus leaving the default of -1 (infinite) on the messages, clogging our queues with dead messages.
Is there a fix or workaround to be able to keep our JMS interface through Spring and be able to set the expiry on each message?
Thanks for your help. |
Check out the JNDI layer. If it allows you to set a default expiration on the Destination you might just have found a bit of luck!  |
Hi, I'm the developer on the project, and we were able to successfully implement the default expiration on the message through the JNDI layer. The solution does what we need it to, all messages get the expiry value now in their MQ headers.
However, if we wanted different expiry values on messages using pure JMS code, I think we're out of luck. I don't necessarily want my applications aware they are using MQ (the reason we use JNDI), but in order to set expiry outside the JNDI layer, my understanding is that you need to use the MQ Client Queue class and do queueObject.setExpiry(millis). Out of the box JMS doesn't have this method, so the apps would be aware they were using MQ for their messaging.
So my question is, is it possible to set expiry through code on JNDI obtained queues (defined with EXP(APP)) without using MQ Client classes/methods in the code...
thanks,
Dan |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Feb 04, 2008 7:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
DanReidy |
Posted: Mon Feb 04, 2008 9:34 am Post subject: |
|
|
Newbie
Joined: 04 Feb 2008 Posts: 4
|
jefflowrey wrote: |
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj25470_.htm |
The docs do show JMSExpiration should map to expiry but it's not working... I put a message on a JNDI defined queue with expiry(APP), set JMSExpiration to 6000000 (pure JMS, no MQ client code), send the message, and the message has an unlimited expiry value when it's placed on the queue. I'm using MQClient v 6.0.2.2.. Am I missing something?
thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Feb 04, 2008 9:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
DanReidy wrote: |
jefflowrey wrote: |
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj25470_.htm |
The docs do show JMSExpiration should map to expiry but it's not working... I put a message on a JNDI defined queue with expiry(APP), set JMSExpiration to 6000000 (pure JMS, no MQ client code), send the message, and the message has an unlimited expiry value when it's placed on the queue. I'm using MQClient v 6.0.2.2.. Am I missing something?
thanks |
The docs DO NOT show that "JMSExpiration" maps to Expiry.
They show that it explicitly doesn't.
The doc I posted is specific about what to set and how to set it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
DanReidy |
Posted: Mon Feb 04, 2008 9:54 am Post subject: |
|
|
Newbie
Joined: 04 Feb 2008 Posts: 4
|
jefflowrey wrote: |
DanReidy wrote: |
jefflowrey wrote: |
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj25470_.htm |
The docs do show JMSExpiration should map to expiry but it's not working... I put a message on a JNDI defined queue with expiry(APP), set JMSExpiration to 6000000 (pure JMS, no MQ client code), send the message, and the message has an unlimited expiry value when it's placed on the queue. I'm using MQClient v 6.0.2.2.. Am I missing something?
thanks |
The docs DO NOT show that "JMSExpiration" maps to Expiry.
They show that it explicitly doesn't.
The doc I posted is specific about what to set and how to set it. |
Sorry, guess that qualifies my "newbie" status. I see that queue URI defines expiration, priority, persistence, etc. So it looks like I can't predefine a queue in JNDI and expect to modify attributes on it after the fact in straight JMS.
thanks,
Dan |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Feb 04, 2008 9:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No.
You just have to use the TimeToLive parameter on send(). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JLRowe |
Posted: Tue Feb 05, 2008 6:08 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
DanReidy wrote: |
jefflowrey wrote: |
DanReidy wrote: |
jefflowrey wrote: |
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj25470_.htm |
The docs do show JMSExpiration should map to expiry but it's not working... I put a message on a JNDI defined queue with expiry(APP), set JMSExpiration to 6000000 (pure JMS, no MQ client code), send the message, and the message has an unlimited expiry value when it's placed on the queue. I'm using MQClient v 6.0.2.2.. Am I missing something?
thanks |
The docs DO NOT show that "JMSExpiration" maps to Expiry.
They show that it explicitly doesn't.
The doc I posted is specific about what to set and how to set it. |
Sorry, guess that qualifies my "newbie" status. I see that queue URI defines expiration, priority, persistence, etc. So it looks like I can't predefine a queue in JNDI and expect to modify attributes on it after the fact in straight JMS.
thanks,
Dan |
Just an idea:
Keep it out of your code, but in your spring configuration.
I assume you are using JMSTemplate, so just subclass it and put all your behaviour in the subclass and configure the expiry with spring. You could even do it with spring AOP. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|