|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Application As A Service |
« View previous topic :: View next topic » |
Author |
Message
|
Nick Hall |
Posted: Mon Nov 17, 2008 6:13 pm Post subject: MQ Application As A Service |
|
|
Newbie
Joined: 28 Oct 2008 Posts: 4
|
G'day,
I am currently running an MQ application as a Windows service. I am accessing messages from the queue using MQGET with the MQGMO_WAIT option. I've got the wait interval set to 5 seconds at the moment, so effectively the service is checking for new messages every 5 seconds.
I was just wondering if there was a more elegant way to do this. What I would like to do would be to have the service enter a sleep mode until a message arrives on the queue. MQ would then send some sort of signal to the service, which would wake it up and it would then process the message.
To this end, I investigate MQ's in-built triggering functionality, but this doesn't seem to be what I want. From what I can see, even using MQ's triggering, you still need to have an application that is constantly polling the initiation queue, which sort of defeats the purpose in my case.
I was just wondering if there was anyway in which to achieve this functionality within MQ, or I will be restricted to what I am currently doing? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 17, 2008 7:11 pm Post subject: Re: MQ Application As A Service |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Nick Hall wrote: |
G'day,
I am currently running an MQ application as a Windows service. I am accessing messages from the queue using MQGET with the MQGMO_WAIT option. I've got the wait interval set to 5 seconds at the moment, so effectively the service is checking for new messages every 5 seconds. |
Wrong. What the wait interval means is that you will be given back control of the thread after 5 seconds without a message. Should a message come along it will be immediately received by the app.
Nick Hall wrote: |
I was just wondering if there was a more elegant way to do this. What I would like to do would be to have the service enter a sleep mode until a message arrives on the queue. MQ would then send some sort of signal to the service, which would wake it up and it would then process the message. |
This is exactly what the MQGet with wait does.
Nick Hall wrote: |
To this end, I investigate MQ's in-built triggering functionality, but this doesn't seem to be what I want. From what I can see, even using MQ's triggering, you still need to have an application that is constantly polling the initiation queue, which sort of defeats the purpose in my case.
I was just wondering if there was anyway in which to achieve this functionality within MQ, or I will be restricted to what I am currently doing? |
You need to get back to the manuals (see info center links at top of page) and read up again. You did not quite understand the way it works (Get with wait).
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Nov 17, 2008 7:25 pm Post subject: Re: MQ Application As A Service |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Nick Hall wrote: |
I am currently running an MQ application as a Windows service. I am accessing messages from the queue using MQGET with the MQGMO_WAIT option. I've got the wait interval set to 5 seconds at the moment, so effectively the service is checking for new messages every 5 seconds.
I was just wondering if there was a more elegant way to do this. What I would like to do would be to have the service enter a sleep mode until a message arrives on the queue. MQ would then send some sort of signal to the service, which would wake it up and it would then process the message. |
As fbj_saper alluded, MQGET with an unlimited wait interval is equivalent to the service sleeping or blocking until a message arrives. The signalling happens within the MQ API layer.
An alternative method in MQ V7.0 is to use asynchronous message consumption (MQCB, MQCTL calls). This allows the thread to do other things while it is waiting for a message to arrive. _________________ Glenn |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|