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 » give me an example of the MQ trigger

Post new topic  Reply to topic
 give me an example of the MQ trigger « View previous topic :: View next topic » 
Author Message
qizhirui
PostPosted: Mon Jul 24, 2006 5:53 am    Post subject: give me an example of the MQ trigger Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

After i read some material about MQ trigger, i understand the mechanism and the whole process .But i hope you can give me an example code of trigger writen in java. help me to understand the MQ trigger.
waiting for your reply
Back to top
View user's profile Send private message Send e-mail MSN Messenger
elvis_gn
PostPosted: Mon Jul 24, 2006 5:59 am    Post subject: Re: give me an example of the MQ trigger Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi qizhirui,
qizhirui wrote:
After i read some material about MQ trigger, i understand the mechanism and the whole process .But i hope you can give me an example code of trigger writen in java. help me to understand the MQ trigger.
waiting for your reply

No qizhirui, you have not read anything on MQ trigger....your post tells it all...

Read, and then ask your relevant doubts.

Regards.
Back to top
View user's profile Send private message Send e-mail
qizhirui
PostPosted: Mon Jul 24, 2006 6:12 am    Post subject: Re: give me an example of the MQ trigger Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

elvis_gn wrote:
Hi qizhirui,
qizhirui wrote:
After i read some material about MQ trigger, i understand the mechanism and the whole process .But i hope you can give me an example code about trigger writen in java. help me to understand the MQ trigger.
waiting for your reply

No qizhirui, you have not read anything on MQ trigger....your post tells it all...

Read, and then ask your relevant doubts.

Regards.

why do you say that" i have not read anything on MQ trigger....",just by your own judgement. If you say like that, it is a shame to me .In a fact , i print some materials about the MQ trigger.


http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/csq0322.htm
I get some material from this link .i will post my questions here
Back to top
View user's profile Send private message Send e-mail MSN Messenger
elvis_gn
PostPosted: Mon Jul 24, 2006 6:28 am    Post subject: Re: give me an example of the MQ trigger Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi qizhirui
qizhirui wrote:
After i read some material about MQ trigger, i understand the mechanism and the whole process .But i hope you can give me an example code of trigger writen in java. help me to understand the MQ trigger.
waiting for your reply

MQ Triggering is not written in Java....triggering is simply settings on the queues which can call java applications wrapped in an exe or bat etc.

You should pick up some of the pdf's or primer to see a simple implementation of a trigger....or search the forum....i think i remember someone giving the steps required for triggering.

Regards.
Back to top
View user's profile Send private message Send e-mail
koko
PostPosted: Mon Jul 24, 2006 7:00 am    Post subject: Reply with quote

Master

Joined: 26 Sep 2003
Posts: 206

qizhirui wrote
Quote:
why do you say that" i have not read anything on MQ trigger....",just by your own judgement. If you say like that, it is a shame to me .In a fact , i print some materials about the MQ trigger


Hey qizhirui

The thing about MQ is you may not understand everything you read at the first shot. Read the manual, take a break and read it again, then again and then again. Each time you read the doc you will gain more and more insight into whats being said and most importantly why something is like that. This doesnt mean you have to read something 100 times before posting a question here but you get better replies if the folks here can know that you did your part and still you are not able to grasp something.

Just my 2 cents

Cheers
_________________
Thanks

Koko
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 24, 2006 9:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

To summarize a bit.

A program that is triggered is not any different from a program that is not triggered - they both get messages from a queue using the same code and logic. The only significant difference is where they get their configuration - a properly written triggered program will get it's queue name configuration and qmgr information from the MQTMC2 structure that is passed to it from the trigger monitor.

A triggered program can be written in any language.

A trigger monitor program is just another MQ application, that reads messages from an initiation queue, and has the responsibility to launch the program described in the initiation message and pass it an MQTMC2 message on the command arguments.

A trigger monitor can be written in any language.

The presupplied trigger monitors are not written in Java. Because of this, they must trigger something that starts a JVM in order to invoke Java code. The easiest way to do this is by using a batch or shell script to isolate the JVM invocation from the Process definition - as JVM invocations can be very long and thus run out of room in the process definition.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
issac
PostPosted: Sat Oct 04, 2008 11:47 pm    Post subject: Reply with quote

Disciple

Joined: 02 Oct 2008
Posts: 158
Location: Shanghai

i guess you're looking for this:
1. define an initial queue for QMGR to put meta-data into; 
DEFINE QLOCAL('QL.TRIGGER_MSGS') REPLACE

2. define a process for trigger monitor to run once triggered; 
DEFINE PROCESS('MY_PROCESS') REPLACE + USERDATA('PARAM1 PARAM2') + APPLICID('c:\mypath\myprog.exe')

3. define a qlocal with trigger type, initial queue name, process name which i just defined; 

DEFINE QLOCAL('QL.IN') REPLACE +
TRIGGER TRIGTYPE (EVERY) INITQ('QL.TRIGGER_MSGS') PROCESS('MY_PROCESS')

4. start runmqtrm to monitor if the initial queue has been put something into, and run the process if it does. 
start runmqtrm -m QMN -q QL.TRIGGER_MSGS
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 » give me an example of the MQ trigger
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.