| Author | 
		  Message
		 | 
		
		  | tom_hanks | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 1:46 am    Post subject: Invoking java applicaton after a message reached to Queue. | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 19 May 2006 Posts: 32
  
  | 
		  
		    
			  
				Hai Every body,
 
 
I need process a message in stand alone java program.
 
 
I written a java program to get message from Queue.
 
so, now i need to invoke this java application each when a message reached to Queue.
 
 
thanks in advance.
 
Tom | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 1:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				Not my area so be gentle with me, but doesn't triggering work on Java if it's stand alone?    _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | tom_hanks | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 2:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 19 May 2006 Posts: 32
  
  | 
		  
		    
			  
				Vitor, 
 
 
triggering means here, just i need call a java(.class) file when a message reached to Queue.
 
 
thanks
 
tom. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 2:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				Java - I speak better Chinese!    _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 8davitt | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 2:20 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 06 Feb 2003 Posts: 37 Location: Seated in front of monitor 
  | 
		  
		    
			  
				This is not difficult. You should be able to use MQ triggering for any language when a message arrives on a queue.
 
 
Write a script which is executed by the MQ trigger processing and the script can execute the $ java classname.class
 
 
Refer to the copious documentation about triggering in the library
 
 
http://www-306.ibm.com/software/integration/wmq/library/
 
 
 
As a Java programmer you should also investigate the use of MessageListeners
 
 
/s | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 2:20 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired) 
  | 
		  
		    
			  
				Vitor is correct... assuming you want to run a "main" class when messages arrive on the queue, you'd use triggering to start the "java" command with your class name.
 
 
And do NOT use trigger EVERY. _________________ -wayne | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 2:28 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| wschutz wrote: | 
   
  
	| Vitor is correct... | 
   
 
 
 
I was right about a Java question!    
 
 
Yay me!    _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Fri Jul 07, 2006 11:23 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				You might want to look at http://www.nynjmq.org which has a nice powerpoint on java triggering in last year's spring session...
 
 
Enjoy    _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | RogerLacroix | 
		  
		    
			  
				 Posted: Sun Jul 09, 2006 9:38 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 15 May 2001 Posts: 3265 Location: London, ON  Canada 
  | 
		  
		    
			  
				Hi,
 
 
Triggering a program is no different from starting it from a command-line / shell. Just wrap it in a batch file or shell script.
 
 
   
	| For Windows wrote: | 
   
  
	@echo off
 
setlocal
 
SET CLASSPATH=blah;blah;.;%CLASSPATH%
 
java com.acme.thing.App %*
 
endlocal | 
   
 
 
   
	| For Unix wrote: | 
   
  
	#!/bin/sh
 
SET CLASSPATH=blah:blah:.:$CLASSPATH
 
java com.acme.thing.App   "$@"
 
 | 
   
 
 
Just remember that MQ passes the MQ TMC structure as the first parameter.
 
 
Regards,
 
Roger Lacroix
 
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
 
Connected to MQ!
 
Twitter | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | tom_hanks | 
		  
		    
			  
				 Posted: Sun Jul 09, 2006 10:46 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 19 May 2006 Posts: 32
  
  | 
		  
		    
			  
				Hai Friends.
 
 
first of all thanks to all of you.
 
 
8davitt : 
 
 
can you give direct link for MQ trigger processing-copious documentation about triggering in the library
 
 
http://www-306.ibm.com/software/integration/wmq/library/ 
 
 
this may be solve my problem. but i am unable to get from that link.
 
 
 
wschutz:
 
 
yes wayne. i need to run "java testprog" when a message arrives queue.
 
where to do it.  i gone thru "Starting a trigger monitor" from info centre. but where to write java command.
 
 
fjb_saper: i downloaded ppt.  but still confused. how to do that??
 
 
RogerLacroix:
 
where to provide my batch file name to get triggered.
 
 
thanks all.
 
-Tom. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Mon Jul 10, 2006 2:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired) 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Mon Jul 10, 2006 2:36 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | tom_hanks | 
		  
		    
			  
				 Posted: Wed Jul 12, 2006 7:31 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 19 May 2006 Posts: 32
  
  | 
		  
		    
			  
				thanks a lot wayne. its working amazing.
 
 
hai jefflowrey. thanks for good link.
 
 
-Tom | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |