Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to trigger a Java Class ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I have a java class which does the retreival of the messages from a local queue. I want to run this java class on a depth trigger. how can i go about doing this ... is it possible to trigger a .class file or will i have to make a dll or exe file to do the needful ...?

If i have to make a dll or exe, assuming my class name is InManager.java then what will be application id ?

Do reply if you have any possible solution to my queries.

thanks in advance.
Avbenz

 
you need not create a .exe or a .dll . You can use the .class itself.

Follow these steps :

1. Create a local queue. Ur queue manager will use this as its initiation queue.

2. Create a process definition with the following parameters:

Application Type : Windows (VERY IMPORTANT)
Application Identifier : java urclass

where urclass is the name of the class file.make sure this exists in ur system classpath.

3. Enable triggering for a local queue. Set triggering control On, trigger type =depth and trigger depth=any number of ur choice. Specify the name of the above-created initiation queue and process definition names.

4. Put message into the local queue enabled for triggering.

if u want to view the results of triggering u can give

">filename.txt" in the environment data property of ur process definition. Any output to the console in ur java application will be redirected to this text file.
 
I followed the above steps on a WindowsNT4 server machine running MQSeries 5.1 and the 'filename.txt' file was never produced. It was a simple PrintHelloWorld.class and lived in the CLASSPATH. I even tried stopping and re-starting the QM and MQExplorer but to no avail. Is there some other enivironment setting in MQ I am missing?
Cheers
Travis White
whitet5@anz.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top