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 » MQ Event Triggering

Post new topic  Reply to topic
 MQ Event Triggering « View previous topic :: View next topic » 
Author Message
jayk0120
PostPosted: Tue Jan 24, 2006 10:03 am    Post subject: MQ Event Triggering Reply with quote

Novice

Joined: 08 Dec 2005
Posts: 12

Hi everyone..

I was wondering if there any way to configure MQ such that it can trigger an event on its own when it receives a message? That is, I do NOT want to use the MDB approach where a listener port is constantly polling for a message and then triggers the onMessage. Instead I would like MQ to create its on event so that it can automatically called the program that will process the incoming message. Is there a way way to do this? I hope I am making sense of what I am trying to achieve.

Could anyone please let me know? If any of you guys have seen this scenario, and have sort of an example code or a good reference that would help a lot!!

Thanks much in advance!

Jay
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Tue Jan 24, 2006 10:16 am    Post subject: Re: MQ Event Triggering Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

jayk0120 wrote:
Could anyone please let me know? If any of you guys have seen this scenario, and have sort of an example code or a good reference that would help a lot!!

It takes a bit of effort to set it all up correctly, but MQ can do this : http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/csq0322.htm Read carefully - when (if?) it doesn't work, I recommend re-reading the sections entitled "Prerequisites for triggering" and "Conditions for a trigger event".
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 24, 2006 12:11 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

One thing to note about triggering compared to MDB is that triggering starts a new JVM, where as an MDB fires an event inside an existing JVM.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mvic
PostPosted: Tue Jan 24, 2006 1:57 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

jefflowrey wrote:
One thing to note about triggering compared to MDB is that triggering starts a new JVM, where as an MDB fires an event inside an existing JVM.

This can be avoided, by avoiding writing programs in Java
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 24, 2006 2:39 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

mvic wrote:
This can be avoided, by avoiding writing programs in Java

Only in a sense.

Triggering always creates a new process. Sometimes that new process is a JVM, and sometimes it's not.

But one would think that jayk0120 wouldn't be concerned about processes that weren't JVMs, when posting to the Java/JMS forum.

But jayk0120 might be very interested to know that triggering isn't a mechanism for invoking an action inside an existing JVM like an app server.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mvic
PostPosted: Tue Jan 24, 2006 2:55 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

jefflowrey wrote:
But one would think that jayk0120 wouldn't be concerned about processes that weren't JVMs, when posting to the Java/JMS forum.

But jayk0120 might be very interested to know that triggering isn't a mechanism for invoking an action inside an existing JVM like an app server.

Both very good points, I agree.
Back to top
View user's profile Send private message
jayk0120
PostPosted: Wed Jan 25, 2006 12:21 am    Post subject: Reply with quote

Novice

Joined: 08 Dec 2005
Posts: 12

Actually you are right...I want the triggering to invoke a java procedure/program(EJB) that lies within an application running under Websphere Application server.

Are you saying this is not possible? Is there a workaround?

Please let me know.

Thanks
Jay
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Wed Jan 25, 2006 3:01 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

jayk0120 wrote:
Actually you are right...I want the triggering to invoke a java procedure/program(EJB) that lies within an application running under Websphere Application server.

If you want to stay inside J2EE then use the JMS facility provided - which is onMessage. I'm not aware of any other J2EE or app server facilities for what you want to do ("would like MQ to create its on event so that it can automatically called the program that will process the incoming message.") - but as I said, I'm not the expert on this.

Could you be a little more explicit about the reasons why onMessage is a problem - you mentioned polling, but what is there about polling that causes a problem?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 25, 2006 4:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It is possible to use a MessageListener instead of an MDB.

It is possible to use triggering to start a separate JVM that then called an EJB running in WAS.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jayk0120
PostPosted: Wed Jan 25, 2006 11:35 am    Post subject: Reply with quote

Novice

Joined: 08 Dec 2005
Posts: 12

Quote:
It is possible to use triggering to start a separate JVM that then called an EJB running in WAS.


Do you guys know where I can find an example of using triggering to do the above?

In fact any example of how to setup triggering would help. I looked at the link on the IBM website that you guys listed, but that alone is not helping me setup and test an example.

Could you please let me know? Thanks again!
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Wed Jan 25, 2006 11:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Look at this thread
http://www.mqseries.net/phpBB2/viewtopic.php?t=12988

What have you done so far?
Have you created queues process definitions etc yet?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fjb_saper
PostPosted: Wed Jan 25, 2006 1:35 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

jayk0120 wrote:
Quote:
It is possible to use triggering to start a separate JVM that then called an EJB running in WAS.


Do you guys know where I can find an example of using triggering to do the above?

In fact any example of how to setup triggering would help. I looked at the link on the IBM website that you guys listed, but that alone is not helping me setup and test an example.

Could you please let me know? Thanks again!


http://www.nynjmq.org/Triggering%20the%20right%20Java%20Environment.zip
You will have to have your standalone java prgm call into the WAS jvm (rmi) and trigger your ejb. If you run a J2EE client be aware that the jars needed on the classpath are nearly as heavy as the stuff to run WAS...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jayk0120
PostPosted: Thu Jan 26, 2006 8:53 am    Post subject: Reply with quote

Novice

Joined: 08 Dec 2005
Posts: 12

thanks for all ur replies so far.

I created an initiation queue and application queue..also i created a process object which points to the application but I am not sure if I m doing this correctly?

DEFINE PROCESS ('RUNSAMPLE') +
REPLACE +
DESCR ('process description') +
APPLTYPE () +
APPLICID ('C:\MQ\RunSample.bat') +
USERDATA '')

do I enter the entire path to the batch file that runs the program in the APPLICID parameter? I just want to test a sample bat program which calls an EJB running on WAS under Windows..For some reason when I try to put a message on the appln queue, the triggering message doesnt appear on the initiation queue even though I set up the conditions for triggering correctly. I really wish I had a running sample code to look at..that would be a gr8 help!
Back to top
View user's profile Send private message Send e-mail
wschutz
PostPosted: Thu Jan 26, 2006 9:08 am    Post subject: Reply with quote

Jedi Knight

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

Quote:
I try to put a message on the appln queue, the triggering message doesnt appear on the initiation queue even though I set up the conditions for triggering correctly
You'll never "see" the message on the init q. If a trigger monitor doesn't have the init q open, the queue manager doesn't generate a message for the initq. If the initq is open, the trigger monitor (usually) gets it immediately.

There is a good section in the APG about the conditions required for triggering, you should consult that, basically, they are:

1. Have a INITQ defined
2. set the initq name in you application queue
3. Have a process defined
4. set the process name in your application queue
5. set trigtype on your applcaiotn queue
6. enable triggering on your appl queue
7. have a trigger monitor (TM) running....

You should see an IPPROCS of 1 on your INITQ if the TM is running. You can also run the TM in the foreground to see if its able to launch your program....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
mvic
PostPosted: Thu Jan 26, 2006 9:15 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

wschutz wrote:
There is a good section in the APG about the conditions required for triggering, you should consult that

...which I already posted above. Here it is again: http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/csq0322.htm

There are no shortcuts with this stuff, jayk0120, you have to spend some time experimenting with it - it's complex. Sorry
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 » MQ Event Triggering
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.