ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Invoking java applicaton after a message reached to Queue.

Post new topic  Reply to topic
 Invoking java applicaton after a message reached to Queue. « View previous topic :: View next topic » 
Author Message
tom_hanks
PostPosted: Fri Jul 07, 2006 1:46 am    Post subject: Invoking java applicaton after a message reached to Queue. Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Jul 07, 2006 1:53 am    Post subject: Reply with quote

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
View user's profile Send private message
tom_hanks
PostPosted: Fri Jul 07, 2006 2:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Jul 07, 2006 2:06 am    Post subject: Reply with quote

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
View user's profile Send private message
8davitt
PostPosted: Fri Jul 07, 2006 2:20 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Fri Jul 07, 2006 2:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Vitor
PostPosted: Fri Jul 07, 2006 2:28 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 07, 2006 11:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
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
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Sun Jul 09, 2006 9:38 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
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
View user's profile Send private message Visit poster's website
tom_hanks
PostPosted: Sun Jul 09, 2006 10:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Mon Jul 10, 2006 2:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Read here:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/csq0322.htm

You need to
(1) setup triggering on your application queue
(2) create a PROCESS definition which will contain a name of a shell script (batch file) to start, in that file is your "java ...." command
(3) create an initiation queue
(4) start a trigger monitor (do it in the foreground first to see it start your program)...
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
jefflowrey
PostPosted: Mon Jul 10, 2006 2:36 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://www.mqseries.net/phpBB2/viewtopic.php?t=12988
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
tom_hanks
PostPosted: Wed Jul 12, 2006 7:31 pm    Post subject: Reply with quote

Apprentice

Joined: 19 May 2006
Posts: 32

thanks a lot wayne. its working amazing.

hai jefflowrey. thanks for good link.

-Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Invoking java applicaton after a message reached to Queue.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.