|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Need recommendation: Queue Listener |
« View previous topic :: View next topic » |
Author |
Message
|
Leigh Kendall |
Posted: Tue Apr 11, 2006 1:44 pm Post subject: |
|
|
 Acolyte
Joined: 10 Apr 2003 Posts: 66 Location: Hartford, CT
|
Jeff -
"...guarantee the synchronization between the two GETTERs."
"...message hasn't already been grabbed by someone else. "
Seeing it's only "me" grabbing the message, I don't think I'll have a conflict with getters. Although I suppose I could get into a race type condition with myself which I had thought of, and as Peter mentioned, I'll make sure to handle 2033 gracefully.
"On the flip side, this is essentially exactly what the JMS MDB Listener Ports do - so you can say that it's the "right" thing to do."
That's good to know... thanks for the feedback btw... _________________ Leigh Kendall |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 11, 2006 2:09 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Write a trigger app to communicate with your service. On communication from the trigger app have the service spawn x worker threads to do the work. Each thread dies on a 2033 (no more messages) after a wait period of x secs to avoid threads dying when there is still work to be done.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
xgnitesh |
Posted: Thu May 04, 2006 9:57 am Post subject: |
|
|
Novice
Joined: 06 Sep 2005 Posts: 19
|
Hi All,
I also have a similar requirement where I want to track messages in a queue on a real time basis. I made a listener class but I am in dilema that the getmessage call is creating too much nework traffic if I want to make it real real time.
I read about triggers but I guess that has a problem too
1. If I use triggers I will have to deploy my client application on the server itself.
2. The overhead of excess traffic will still be there between initiation queue and trigger monitor.
Please advise me if I am wrong.
Thanks
Nitesh |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu May 04, 2006 10:38 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Nitesh.....As requested I wish to advise you that you are wrong.
Triggering need not and should not cause excessive overhead unless you are thinking of triggering on EVERY (which is just plain dumb anyway).
Also there are ways of trigger applications on client machines as well as servers. There is a support pack for doing this (MA7K?). Check out the IBM support pack website.
I don't think it has been removed. |
|
Back to top |
|
 |
Leigh Kendall |
Posted: Thu May 04, 2006 11:14 am Post subject: |
|
|
 Acolyte
Joined: 10 Apr 2003 Posts: 66 Location: Hartford, CT
|
Nitesh -
What I ended up doing and it works well, is in .NET I created a listener class that does nothing but browse on the queue. If it can browse/wait/get (non-destructive) a message then the listener raises an event to a dispatch class, goes back to listening, and the dispatch class puts a request in the threadpool for a processor class to process the message it pulls of the queue. Around it goes. By using the threadpool, your messages will be pulled of the queue in a multithreaded manner. Even though the listener is single threaded, it runs so fast that I actually had to sleep the thread after raising the "new" message event so as to not create to many processors for not enough messages which worse case just generates an mq no_msg_available error. Note that this is also using COM+ to synch the gets/puts and writes to Oracle. So far everything has been working like a charm with no excessive use of memory or CPU. Note that if you don't sleep the thread (~100ms) after firing the event, it can get into a bit of a race condition chewing up cpu cycles, but as long as you sleep a bit it's okay...
HTH, _________________ Leigh Kendall |
|
Back to top |
|
 |
Leigh Kendall |
Posted: Thu May 04, 2006 11:16 am Post subject: |
|
|
 Acolyte
Joined: 10 Apr 2003 Posts: 66 Location: Hartford, CT
|
Nitesh -
I addition to that, if you can use MQ 6.0 (I'm stuck with 5.3); there is a new .NET Monitor piece which will fire with/without COM+ support your own custom assembly. If I were able to use 6.0 I'd probably have used that instead of rolling my own... _________________ Leigh Kendall |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|