| Author | 
		  Message
		 | 
		
		  | wbimb | 
		  
		    
			  
				 Posted: Mon May 05, 2008 9:15 pm    Post subject: Put message to local q when qmgr starts | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 17 Aug 2006 Posts: 144
  
  | 
		  
		    
			  
				Does anyone know how can i put a message to a local queue when Qmgr starts
 
 
I tried creating a service with amqsput TEST TESTQMgr but it doesnt fire amqsput | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Gaya3 | 
		  
		    
			  
				 Posted: Mon May 05, 2008 9:18 pm    Post subject: Re: Put message to local q when qmgr starts | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US 
  | 
		  
		    
			  
				
   
	| wbimb wrote: | 
   
  
	
 
I tried creating a service with amqsput TEST TESTQMgr but it doesnt fire amqsput | 
   
 
 
 
What does this means, are you getting any error?
 
If so, Please post that....rather being very abstract.
 
 
go to sample directory -->  /opt/mqm/samp/bin and execute the same and verify.
 
 
Regards
 
Gayathri _________________ Regards
 
Gayathri
 
-----------------------------------------------
 
Do Something Before you Die | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wbimb | 
		  
		    
			  
				 Posted: Mon May 05, 2008 9:21 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 17 Aug 2006 Posts: 144
  
  | 
		  
		    
			  
				I m using MQ v6 on Windows XP
 
 
so in start command i put amqsput
 
 
and in start args i put TEST TESTQMgr <c:\Message.txt
 
 
but it doesnt start amqsput | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Gaya3 | 
		  
		    
			  
				 Posted: Mon May 05, 2008 9:26 pm    Post subject: Re: Put message to local q when qmgr starts | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US 
  | 
		  
		    
			  
				[quote="Gaya3]
 
go to sample directory -->  /opt/mqm/samp/bin and execute the same and verify.[/quote]
 
 
Did you try this....
 
 
Regards
 
Gayathri _________________ Regards
 
Gayathri
 
-----------------------------------------------
 
Do Something Before you Die | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wbimb | 
		  
		    
			  
				 Posted: Mon May 05, 2008 9:31 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 17 Aug 2006 Posts: 144
  
  | 
		  
		    
			  
				Yes Gaya
 
 
When i execute it from command prompt
 
 
amqsput TEST TESTQMgr <c:\Message.txt 
 
 
it works fine | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Gaya3 | 
		  
		    
			  
				 Posted: Mon May 05, 2008 10:15 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US 
  | 
		  
		    
			  
				why do you want to create a service for amqsput 
 
 
Regards
 
Gayathri _________________ Regards
 
Gayathri
 
-----------------------------------------------
 
Do Something Before you Die | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wbimb | 
		  
		    
			  
				 Posted: Mon May 05, 2008 10:17 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 17 Aug 2006 Posts: 144
  
  | 
		  
		    
			  
				I want to put a message to a local queue when the Queue Manager starts, so i thought it will be possible with service,
 
 
Do you know anyother way i can achieve it | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Tue May 06, 2008 12:45 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| wbimb wrote: | 
   
  
	| I want to put a message to a local queue when the Queue Manager starts, so i thought it will be possible with service, | 
   
 
 
 
It should be. Esnure the amqsput runs after the queue manager has finished coming up, and diagnose using MQ reason codes in the normal way. 
 
 
   
	| wbimb wrote: | 
   
  
	| Do you know anyother way i can achieve it | 
   
 
 
 
Achieve what? The queue manager effectively talking to itself? I struggle to see what possible use this could be to you, and I would be devistated to discover this was your only option......    _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wbimb | 
		  
		    
			  
				 Posted: Tue May 06, 2008 1:10 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 17 Aug 2006 Posts: 144
  
  | 
		  
		    
			  
				It is not....amsgput is not coming up
 
 
If I manually start the service and sametime check task manager process i dont see any amqsput process getting started | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Tue May 06, 2008 1:16 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| wbimb wrote: | 
   
  
	| It is not....amsgput is not coming up | 
   
 
 
 
Then you've got a problem with the service configuration somewhere, and the usual diagnotics should be applied. My guess (and it's only a guess) is amqsput is trying to write to stdout & there's no stdout context for it. Speak to your Windows admin. 
 
 
You might also want to rewrite amqsput so it's non-interactive.
 
 
I still fail to see why you'd want to do something so apparently pointless. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bruce2359 | 
		  
		    
			  
				 Posted: Tue May 06, 2008 6:29 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Poobah
 
 Joined: 05 Jan 2008 Posts: 9486 Location: US: west coast, almost. Otherwise, enroute. 
  | 
		  
		    
			  
				I'll guess:  the poster wants to trigger an application at qmgr startup.
 
 
1 (guess) down; 9 to go... _________________ 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Tue May 06, 2008 6:41 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| bruce2359 wrote: | 
   
  
	I'll guess:  the poster wants to trigger an application at qmgr startup.
 
 | 
   
 
 
 
It's a fair guess. But why (in that circumstance) would the poster not start the triggered application directly as a service and save a step? Why set up a service to trigger it? _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bruce2359 | 
		  
		    
			  
				 Posted: Tue May 06, 2008 7:01 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Poobah
 
 Joined: 05 Jan 2008 Posts: 9486 Location: US: west coast, almost. Otherwise, enroute. 
  | 
		  
		    
			  
				wbimb:  exactly what business process or function are you trying to achieve by putting a message in a queue at qmgr startup? _________________ 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | RogerLacroix | 
		  
		    
			  
				 Posted: Wed May 07, 2008 12:30 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 15 May 2001 Posts: 3265 Location: London, ON  Canada 
  | 
		  
		    
			  
				Hi,
 
 
amqsput expects StdIn input or redirection of input from a file.  I'm pretty sure the Service cannot handle redirection.
 
 
Therefore, you will need to alter / update amqsput for your needs.
 
 
Here's a working sample that puts a message on a queue at queue manager startup:
 
 
 
 
 
Regards,
 
Roger Lacroix
 
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
 
Connected to MQ!
 
Twitter | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wbimb | 
		  
		    
			  
				 Posted: Wed May 07, 2008 9:25 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 17 Aug 2006 Posts: 144
  
  | 
		  
		    
			  
				Hey Roger
 
 
Thanks. I modified amqsput as mentioned by you and it worked | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |