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 » Setting expiry time for messages in jms

Post new topic  Reply to topic
 Setting expiry time for messages in jms « View previous topic :: View next topic » 
Author Message
Anthony Raj
PostPosted: Sun May 09, 2010 9:41 am    Post subject: Setting expiry time for messages in jms Reply with quote

Novice

Joined: 09 May 2010
Posts: 12

Hi, we have jms configuration in our application server , the jms destination queue is configured with the MQ queues, The messages which are strucking in MQ queues(which is configured to JMS destination queue) needs to be expired after 30 minutes

I had tried to set the persistence to non persistence, expiry to specified and expiry time to 180000 of jms but its not working, In MQ local queue we had set the DEFPSIST to YES

We have mq server

Our application server and mq server are running with different id

Could some one help me resolve this issue
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun May 09, 2010 5:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Check the JNDI attributes of the destination. You can set those parameters there. Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Anthony Raj
PostPosted: Sun May 09, 2010 7:40 pm    Post subject: Reply with quote

Novice

Joined: 09 May 2010
Posts: 12

Hi Grand, i had already set the below JNDI attributes

Persistence <---> Non Persistence
Expiry <----> Specified
Specified Expiry <----> 1800000

But still its not working

Please let me know if any other attributes needs to be configured
Back to top
View user's profile Send private message
AkankshA
PostPosted: Sun May 09, 2010 8:12 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

not very sure if it will work but did you try setting the expiry in MQ headers..
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Mon May 10, 2010 11:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Anthony Raj wrote:
Hi Grand, i had already set the below JNDI attributes

Persistence <---> Non Persistence
Expiry <----> Specified
Specified Expiry <----> 1800000

But still its not working

Please let me know if any other attributes needs to be configured

Did you also set those attributes as specified? When the message hits the queue it should have the values.... How did you define the queue in the program? Retrieve from JNDI or created from the session?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Anthony Raj
PostPosted: Mon May 10, 2010 7:45 pm    Post subject: Reply with quote

Novice

Joined: 09 May 2010
Posts: 12

Yes i had set this in Websphere application server admin console

We are putting the message in the JNDI (where this setup is done)
Back to top
View user's profile Send private message
Anthony Raj
PostPosted: Tue May 11, 2010 8:21 am    Post subject: Reply with quote

Novice

Joined: 09 May 2010
Posts: 12

Hi Could some explain me if the expiry time is set in receiver queue, will the message get expire?

How the jndi property is applied on the messages arriving on the receiver queue
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 11, 2010 8:31 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Anthony Raj wrote:
How the jndi property is applied on the messages arriving on the receiver queue


Well I don't know JNDI or Java that much but it seems to me that once a message has arrived in the receiving queue that's it for the properties because they would have been set (via JNDI or otherwise) when they were sent. So I don't see that any JNDI setting is going to influence a message being read.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Anthony Raj
PostPosted: Tue May 11, 2010 8:50 am    Post subject: Reply with quote

Novice

Joined: 09 May 2010
Posts: 12

Thanks Grand, So setting the JNDI property (expiry, persistence etc) for receiver queue is useless?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 11, 2010 9:29 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Anthony Raj wrote:
So setting the JNDI property (expiry, persistence etc) for receiver queue is useless?


Again, Java & JNDI are not my thing but the properties you quote are defined in the base software when the message is created and sent. I don't see a mechanism by which they'd be relevant on the receiver because how would these properties be changed?

You need to understand that these properties are not queue properties but message properties, so setting them in JNDI or elsewhere doesn't force them. They are relevant at the sending end (as I understand it and perhaps misunderstand it) because a message sent using a JNDI destination inherits the properties from the JNDI as it goes past.

I certainly don't see how setting the JNDI to have persistence or expiry for a given queue would in any way affect the messages already delivered to it. There's no mechanism I'm aware of that would "retrofit" these properties onto existing messages and it would be dangerous if there was. Consider using this to enforce all messages as persistent; messages would still arrive in a non-persistent state and could be lost if there's a problem before they could be changed.

Reading back through your post, if the original problem is that there are messages sitting on your queue which are more than 30 mins old which should disappear but don't, you need to get expiry set at the sending end or use one of the other solutions to your problem which have been discussed in here over the years. You're not the first to encounter this (if indeed this is what you're encountering and I've not misunderstood).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue May 11, 2010 4:57 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I still haven't seen any proof that Expiry is not getting set correctly. I hope you are not using the queue depth alone to determine that Expiry is or is not being set properly.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Anthony Raj
PostPosted: Tue May 11, 2010 9:04 pm    Post subject: Reply with quote

Novice

Joined: 09 May 2010
Posts: 12

Thanks Grand, i had set the expire in sender queue JNDI it works fine

But if i set the the expire in receiver JNDI its not working

Now my messages are getting expired after 30 min
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 12, 2010 1:54 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Anthony Raj wrote:
Thanks Grand, i had set the expire in sender queue JNDI it works fine

Great, this is what you are supposed to do.

Anthony Raj wrote:
But if i set the the expire in receiver JNDI its not working

As said before NO NO NO. Once the message has hit a queue (remote, xmit, alias, local) its attributes are set in stone. No changing them again.
_________________
MQ & Broker admin
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 » Setting expiry time for messages in jms
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.