| Author | Message | 
		
		  | ealcantara | 
			  
				|  Posted: Mon May 06, 2013 5:53 am    Post subject: Expiry doubt - the value is decremented only after commit ? |   |  | 
		
		  | Novice
 
 
 Joined: 16 May 2005Posts: 13
 
 
 | 
			  
				| Hi , 
 When EXPIRY is used, the value is decremented only after COMMIT or after MQPUT ?
 
 Regards,
 
 Eros Alcantara.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | bruce2359 | 
			  
				|  Posted: Mon May 06, 2013 8:10 am    Post subject: |   |  | 
		
		  |  Poobah
 
 
 Joined: 05 Jan 2008Posts: 9486
 Location: US: west coast, almost. Otherwise, enroute.
 
 | 
			  
				| Expiry  has been discussed here before. Search. 
 Why is this important?  Expired messages will not be delivered to any consuming application.
 _________________
 I like deadlines. I like to wave as they pass by.
 ב''ה
 Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | ealcantara | 
			  
				|  Posted: Mon May 06, 2013 8:31 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 May 2005Posts: 13
 
 
 | 
			  
				| Hi Bruce, 
 I've already search.
 
 You are very stupid !
 
 If you don't like help , why you awnswer questions ? Only to show how good or intelligent you are.
 
 Please don't waste your precious time if I make new questions in future.
 
 Eros.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | exerk | 
			  
				|  Posted: Mon May 06, 2013 8:42 am    Post subject: |   |  | 
		
		  |  Jedi Council
 
 
 Joined: 02 Nov 2006Posts: 6339
 
 
 | 
			  
				| 
   
	| ealcantara wrote: |  
	| Hi Bruce, 
 I've already search.
 
 You are very stupid !
 
 If you don't like help , why you awnswer questions ? Only to show how good or intelligent you are.
 
 Please don't waste your precious time if I make new questions in future.
 
 Eros.
 |  I think an apology to bruce2359 is in order, your reply is outside the bounds of acceptability on this forum.
 _________________
 It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | ealcantara | 
			  
				|  Posted: Mon May 06, 2013 8:59 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 May 2005Posts: 13
 
 
 | 
			  
				| No problem. 
 I'm ready to apologize, if Bruce do also.
 
 I'm like so much this forum, but I think the respect is most important than knowledge.
 
 Regards,
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Mon May 06, 2013 9:15 am    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| I can say the same exact set of words, and mean them respectfully or entirely disrepectfully. 
 The distinction in meaning can be conveyed by many things, hand gestures, facial expressions, tones of voice, etc.
 
 Very very few of these are possible to convey using text.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | ealcantara | 
			  
				|  Posted: Mon May 06, 2013 9:36 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 May 2005Posts: 13
 
 
 | 
			  
				| I'm sorry to all. In especial to Bruce. I'm the most stupid here. 
 Have a nice day and sorry again.
 
 Eros.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | PeterPotkay | 
			  
				|  Posted: Mon May 06, 2013 9:46 am    Post subject: |   |  | 
		
		  |  Poobah
 
 
 Joined: 15 May 2001Posts: 7723
 
 
 | 
			  
				| Even if the bare minimum that you need to know is that an expired message will never be delivered to an app, I think the original question is an interesting one. 
 If the legitimate Expiry value you want your messages to start with is 500, but your app needs 3 seconds to do some other stuff between the MQPUT under syncpoint and the eventual MQCMIT, what do you code for the MQMD_Expiry? Do you code 500, or 800? (5000 or 8000 for all you JMS fans)
 _________________
 Peter Potkay
 Keep Calm and MQ On
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | ealcantara | 
			  
				|  Posted: Mon May 06, 2013 9:57 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 May 2005Posts: 13
 
 
 | 
			  
				| Hi Peter, 
 This is my doubt !
 
 And if the application set 10 seconds to expiry and , for some reason, issue the commit only after 15 seconds, what occurs ? The message is discarded ? Or will discarded only 10 second after commit ?
 
 Thanks ,
 
 Eros.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Mon May 06, 2013 10:19 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| ealcantara wrote: |  
	| And if the application set 10 seconds to expiry and , for some reason, issue the commit only after 15 seconds, what occurs ? The message is discarded ? Or will discarded only 10 second after commit ? |  
 Expiry is an MQMD field set by the application that puts the message (see here). So the message will go onto the queue with whatever value is set by that application. The value is not reset by the commit action, which ends the unit of work and makes the message as it has been put eligible for retrieval. If the expiry time has run down in the meantime the message will be cleaned off by the queue manager either automatically or when the application does a get against the queue.
 
 Or maybe it doesn't work like that.
 
 But you could find out by writing a test application that puts a message with a 10 second expiry, executes a sleep statement for 15 seconds and then does a commit in much less time than it took to go round it here.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | bruce2359 | 
			  
				|  Posted: Mon May 06, 2013 10:37 am    Post subject: |   |  | 
		
		  |  Poobah
 
 
 Joined: 05 Jan 2008Posts: 9486
 Location: US: west coast, almost. Otherwise, enroute.
 
 | 
			  
				| 
   
	| ealcantara wrote: |  
	| This is my doubt ! 
 And if the application set 10 seconds to expiry and , for some reason, issue the commit only after 15 seconds, what occurs ? The message is discarded ? Or will discarded only 10 second after commit ?
 
 Thanks ,
 
 Eros.
 |  In practical terms it makes no difference exactly when and how the WMQ internals do 'garbage collection.'
 
 That is, expiry begins when a message is put to a queue.
 
 Once the expiry value is met, no app will be able to consume the message.
 _________________
 I like deadlines. I like to wave as they pass by.
 ב''ה
 Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | ealcantara | 
			  
				|  Posted: Mon May 06, 2013 10:52 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 May 2005Posts: 13
 
 
 | 
			  
				| Hi Bruce, 
 I'm sorry again. And thanks to answer.
 
 I guess there is difference if expiry begins when a message is put to queue or if begins when a commit is issued.
 
 I will write a program to test, as Vitor suggest.
 
 Thanks,
 
 Eros.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Mon May 06, 2013 11:01 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| ealcantara wrote: |  
	| I will write a program to test, as Vitor suggest. |  
 Be sure & post your results. I'd love to know if I'm right....
  _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | PeterPotkay | 
			  
				|  Posted: Mon May 06, 2013 11:57 am    Post subject: |   |  | 
		
		  |  Poobah
 
 
 Joined: 15 May 2001Posts: 7723
 
 
 | 
			  
				| I'm guessing the behaviour will be the opposite of what Vitor suggested, that the ticker will not start until the message has been committed. But I have no evidence to back this up and I don't feel strongly about it. I've always been taught that the Expiry value is decremented by the Queue manager only when the message is on the queue. Soooo, is an uncomitted message "on the queue"? 
 Taking this further, what if your app gets a message off the queue under syncpoint, the message only has 1 second of Expiry left, but your app MQBACKs it to the queue after 3 seconds? Does the message find itself with 1 second of Expiry still left (eligible to be picked up by other instances of your app if multiples are watching the queue), or does it go back on the queue expired?
 
 The only problem with testing this and seeing how it works, without having documentation that explains how it works, is that you can't assume it will work like that going forward. If its undocumented behaviour, IBM is free to change the behaviour.
 _________________
 Peter Potkay
 Keep Calm and MQ On
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Mon May 06, 2013 12:33 pm    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| PeterPotkay wrote: |  
	| I'm guessing the behaviour will be the opposite of what Vitor suggested, that the ticker will not start until the message has been committed. |  
 Hey I wouldn't be surprised.
 
 
 
   
	| PeterPotkay wrote: |  
	| If its undocumented behaviour, IBM is free to change the behaviour. |  
 Quite. But it would still be interesting to know what v7 does on the ground.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |