Author |
Message
|
Anthony Raj |
Posted: Sun May 09, 2010 9:41 am Post subject: Setting expiry time for messages in jms |
|
|
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 |
|
 |
fjb_saper |
Posted: Sun May 09, 2010 5:34 pm Post subject: |
|
|
 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 |
|
 |
Anthony Raj |
Posted: Sun May 09, 2010 7:40 pm Post subject: |
|
|
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 |
|
 |
AkankshA |
Posted: Sun May 09, 2010 8:12 pm Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Mon May 10, 2010 11:14 am Post subject: |
|
|
 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 |
|
 |
Anthony Raj |
Posted: Mon May 10, 2010 7:45 pm Post subject: |
|
|
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 |
|
 |
Anthony Raj |
Posted: Tue May 11, 2010 8:21 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Tue May 11, 2010 8:31 am Post subject: |
|
|
 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 |
|
 |
Anthony Raj |
Posted: Tue May 11, 2010 8:50 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Tue May 11, 2010 9:29 am Post subject: |
|
|
 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 |
|
 |
PeterPotkay |
Posted: Tue May 11, 2010 4:57 pm Post subject: |
|
|
 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 |
|
 |
Anthony Raj |
Posted: Tue May 11, 2010 9:04 pm Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Wed May 12, 2010 1:54 pm Post subject: |
|
|
 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 |
|
 |
|