ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Spring, MQ Series and the use of Expiry

Post new topic  Reply to topic
 Spring, MQ Series and the use of Expiry « View previous topic :: View next topic » 
Author Message
bpcrue
PostPosted: Sun Feb 03, 2008 11:46 am    Post subject: Spring, MQ Series and the use of Expiry Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sun Feb 03, 2008 4:09 pm    Post subject: Re: Spring, MQ Series and the use of Expiry Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

bpcrue wrote:
IBM MQ 6.1


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
View user's profile Send private message
fjb_saper
PostPosted: Sun Feb 03, 2008 5:21 pm    Post subject: Re: Spring, MQ Series and the use of Expiry Reply with quote

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
View user's profile Send private message Send e-mail
DanReidy
PostPosted: Mon Feb 04, 2008 7:36 am    Post subject: Re: Spring, MQ Series and the use of Expiry Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 04, 2008 7:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj25470_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DanReidy
PostPosted: Mon Feb 04, 2008 9:34 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 04, 2008 9:35 am    Post subject: Reply with quote

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
View user's profile Send private message
DanReidy
PostPosted: Mon Feb 04, 2008 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 04, 2008 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message
JLRowe
PostPosted: Tue Feb 05, 2008 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Spring, MQ Series and the use of Expiry
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.