| Author | Message | 
		
		  | tango | 
			  
				|  Posted: Thu Nov 22, 2007 1:27 am    Post subject: Replaying (resubmit) many messages |   |  | 
		
		  | Apprentice
 
 
 Joined: 14 Mar 2007Posts: 42
 
 
 | 
			  
				| Hi, 
 Can anyone suggest how to write a script for replaying messages (Linux)?  Due to a number of earlier failures at endpoints, we have a 'huge' number of messages on a failure queue that now need to be resubmitted.
 
 At the moment I'm replaying each message manually which of course is very inefficient and tedious.
 
 TIA
 TH
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu Nov 22, 2007 1:36 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| Set up an alias with the name of the queue the endpoint is expecting to read from that point to the failure queue. Start the endpoint, when all the messages are read, remove the alias. _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu Nov 22, 2007 1:37 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| Or use the q or qload programs to move the messages onto the "right" queue. _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | tango | 
			  
				|  Posted: Thu Nov 22, 2007 2:11 am    Post subject: |   |  | 
		
		  | Apprentice
 
 
 Joined: 14 Mar 2007Posts: 42
 
 
 | 
			  
				| Hi, 
 Setting up an alias queue in for this particular production env is not permitted.  As for the q utility, that's what I'm using at the moment for manual playback of each message.  I can't just pass all the messages ( thousands of them) into it as I first need to get the Correlation ID from each message and strip it before resubmitting, as the system (the way we have it set up) will flag it as a duplicate and not send it (business rules mean we can't send duplicates).
 
 I need a script to get the messageID of each message, strip the CorrelID, then moving each message back onto the appropriate queue.
 
 I'm guessing I need to use 'q' to browse the failure queue and redirect to a file... but how do I grep out the messageID for each message from the file?  Looking at the output file from the q browse, the MessageID is on a seperate line from the MessageID field... and then another potential issue is that not all the messages on this failure queue are for replaying (some are error event messages)... hence not as easy as it seems.
 
 Any advice appreciated.
 
 TH
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu Nov 22, 2007 2:24 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| I'd consider qload rather than q. Unloads to a file out of the box, no redirection necessary. 
 The rest is scripting.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu Nov 22, 2007 2:26 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| Also (IMHO) it's a bit harsh saying you can't define an alias in prod. I see the logic in normal circumstances, but you're recovering from a failure which by definition is not a normal circumstances. Those who guard production could cut you a little slack here. _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | tango | 
			  
				|  Posted: Thu Nov 22, 2007 3:20 am    Post subject: |   |  | 
		
		  | Apprentice
 
 
 Joined: 14 Mar 2007Posts: 42
 
 
 | 
			  
				| Thanks, I'll look into the QLoad utility. |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | dkeister | 
			  
				|  Posted: Thu Nov 22, 2007 8:47 am    Post subject: |   |  | 
		
		  | Disciple
 
 
 Joined: 25 Mar 2002Posts: 184
 Location: Purchase, New York
 
 | 
			  
				| You might try MQExerciser (www.mqexerciser.com).  It is a windows based VB application that establishes a client connection to the queue manager.  You can then open the queue with the messages and the queue that you want to receive the messages.  Then tell MQExerciser to move (or copy) the messages (and optionally save them) to another queue.  One click does it all. _________________
 Dean Keister
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Thu Nov 22, 2007 11:07 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| I think you'll need to write your own little program to move the messages. What you describe is not a simple move message from QA to QB but :
 analyze message if right type, move to QB and strip off correlId....
 
 Enjoy
  _________________
 MQ & Broker admin
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | JosephGramig | 
			  
				|  Posted: Thu Nov 22, 2007 12:12 pm    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 09 Feb 2006Posts: 1244
 Location: Gold Coast of Florida, USA
 
 | 
			  
				| Well, it would not be that big of a deal using the MA0T support pack. 
 It is for testing, but it would easily read all the messages from one queue and put them on another.
 
 It is pretty cool, you can even tell it to do it at a specific rate, if you wanted to.
 
 The support pack comes with sample scripts, so look that the get script and the put script and make your own script from that.
 _________________
 Joseph
 Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
 Solution Designer - WMQ V6.0
 Solution Developer - WMB V6.1 & V6.0, WMQ V5.3
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |