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 » Need suggestion

Post new topic  Reply to topic Goto page Previous  1, 2
 Need suggestion « View previous topic :: View next topic » 
Author Message
Seshagiri
PostPosted: Mon Oct 17, 2011 10:14 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 17, 2011 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Seshagiri
PostPosted: Mon Oct 17, 2011 10:20 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 17, 2011 10:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Oct 17, 2011 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Oct 17, 2011 3:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Need suggestion
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.