|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Need suggestion |
« View previous topic :: View next topic » |
Author |
Message
|
Seshagiri |
Posted: Mon Oct 17, 2011 10:14 am Post subject: |
|
|
Apprentice
Joined: 04 Oct 2011 Posts: 42
|
Vitor wrote: |
Because your code should make no reference to queue depth but open the queue, process the messages and then close it a suitible interval after the last message arrives so as to be sure there are no more. As my most worthy associate points out, this is nothing to do with how many opperations are in a Uow.. |
Here program makes reference to q depth and if qdepth>0 the processing begins and if qdepth is less or greater than 1000 then process depending on the available messages. ie if <1000 take all the messages for processing and if >1000 the take only 1000 for processing.
Vitor wrote: |
If queue depth is zero, why is your application running?
. |
The design is that the program has to poll all the time on this queue. It is demon process. Its not that if only messages are there then only the application should run.
Vitor wrote: |
Fix the channel definition(s), and/or the underlying network so that the channel doesn't go into retry. As a first move, try looking in the logs to see why the channel is in retry rather than blindly issuing inappropriate commands that cause more problems than they fix. |
what do you mean by fix the channel definitions?. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 17, 2011 10:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Seshagiri wrote: |
Here program makes reference to q depth and if qdepth>0 the processing begins and if qdepth is less or greater than 1000 then process depending on the available messages. ie if <1000 take all the messages for processing and if >1000 the take only 1000 for processing. |
No.
You should get a message.
If you are told there are no messages, you should quit.
If you get a message, you should process it.
And then get the next message. |
|
Back to top |
|
 |
Seshagiri |
Posted: Mon Oct 17, 2011 10:20 am Post subject: |
|
|
Apprentice
Joined: 04 Oct 2011 Posts: 42
|
mqjeff wrote: |
No.
You should get a message.
If you are told there are no messages, you should quit.
If you get a message, you should process it.
And then get the next message. |
Why like that?
mqjeff wrote: |
If you get a message, you should process it.
. |
You mean here also commit after processing |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 17, 2011 10:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Seshagiri wrote: |
mqjeff wrote: |
No.
You should get a message.
If you are told there are no messages, you should quit.
If you get a message, you should process it.
And then get the next message. |
Why like that? |
Because the way you do it is the wrong way to do it.
Because queue depth is unreliable, as it includes messages that are not committed yet.
Because this is the best practices way to do it. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Oct 17, 2011 10:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Because the way you do it is the wrong way to do it.
Because queue depth is unreliable, as it includes messages that are not committed yet.
Because this is the best practices way to do it. |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Oct 17, 2011 3:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Vitor wrote: |
mqjeff wrote: |
Because the way you do it is the wrong way to do it.
Because queue depth is unreliable, as it includes messages that are not committed yet.
Because this is the best practices way to do it. |
 |
As your program runs as a daemon, it should have following characteristics:
It should:
- use the Fail if quiesce flag
- open the queue once and keep it open
- use get with wait
- process messages whenever they are available and commit every x (1,000?) or when no more messages are available
- clean up resources (open queue, connection) when passed the exit command or when qmgr is quiescing or on exception
- have some logic to reconnect
Have fun  _________________ MQ & Broker admin |
|
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
|
|
|
|