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 » ConnectionConsumer producing wrong backout counts?

Post new topic  Reply to topic
 ConnectionConsumer producing wrong backout counts? « View previous topic :: View next topic » 
Author Message
griffel
PostPosted: Thu Apr 28, 2005 6:04 am    Post subject: ConnectionConsumer producing wrong backout counts? Reply with quote

Novice

Joined: 22 Mar 2005
Posts: 23

Our configuration:
WebSphere MQ 5.3 CSD9 for Windows (here 2000) as a Java JMS client to connect to a queue manager running as WebSphere MQ 5.3.1 on z/OS 1.6 via SSLed SVRCONN-channels.

Our problem:
Stopping an instance of IBM's ASF ConnectionConsumer implementation leaves poisoned messages in the queue it listens to. Poisoning is given by rather arbitrarily set backout-count numbers. The queue itself has BOTHRESH(1), a defined backout queue, and is HARDENBO.

The problem occurs very rarely. In each case, there seems to have been a MQGET running for quite a long time (minutes, up to hours due to errorneously processing in the code called by the consumers' listener "onMessage"). Most of the time, it works like designed.

Our question:
Can anyone tell about the secret when, i.e. under which exact circumstances, the consumer gets in trouble with backout-counting and misses to backout the currently processed message to the provided backout queue?

As always, any help is very much appreciated.
Back to top
View user's profile Send private message
griffel
PostPosted: Thu Apr 28, 2005 10:32 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2005
Posts: 23

Some more details, since we now have built a standalone test
(former observations came from our production systems directly):

The test instantiates a ConnectionConsumer listening on a queue
configured as described above. The consumer has a SessionPool
with 20 sessions available for use.
Since a ConnectionConsumer.stop() will stop the SessionPool which,
in turn, will stop the Sessions, we included a delay of 10 seconds before
each Session.close() is actually called within our SessionPool-implementation. This is for giving the "onMessage"-activities running in parallel some chance to end up with their work in a normal way, even though the consumer is in stopping mode. (BTW, has anyone recommendations for what's the best design pattern to avoid duplicate message processing with a JMS ConnectionConsumer?)

Now, the test code puts a message into the queue. Then it calls stop() on the consumer. This results in still ("again") having the message in the
queue with its backout-counter set to 1. Everything fine up to this point.

Then the test code starts a new consumer listening on the queue again.
Now, things get wired: On correctly behaving systems the consumer
recognizes the backout-count already set to 1, compares it to the queue's
defined threshold, and correctly puts the message into the intended backout queue.
On broken systems, the message reappears in the queue with a backout
counter set to values like 3, 5, 27, 33 and the like.

We've run this test against all our MQ installations, here's the result:
- WebSphere MQ for Windows 530.9 (CSD9) on Windows 2000: OK
- WebSphere MQ for Solaris 530.9 (CSD9) on Solaris 9: OK
- WebSphere MQ for z/OS 531 on z/OS 1.4: FAILED
- WebSphere MQ for z/OS 531 on z/OS 1.6: FAILED

BUT: We have 9 Queue-Managers running distributed over 2 hosts and
4 LPARs. One of these QMs does its job OK! (this one runs under zOS 1.6,
but some of the others do as well).

I think this definitly is a bug inside MQ dependent on its system environment. From a programmers' and sysadmins' point of view
all MQ installations / configuration seems to be completely the same.
I don't know if there might be other stuff around on the hosts which
might interfere with MQ. My last hope for this is PTF UK01818 which we
haven't applied yet.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 28, 2005 11:20 am    Post subject: Reply with quote

Grand High Poobah

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

Quote:
(BTW, has anyone recommendations for what's the best design pattern to avoid duplicate message processing with a JMS ConnectionConsumer?)


Should never happen. JMS Consumer is designed in such a way that if the message is being consumed there is no problem.

Now you may run into problems with poison messages. Assuming your queue is serviced by multiple consumers indiscriminately (first come first serve) what you may get is:
1st attemp consumer n -- rollback
2nd attempt consumer x -- rollback
3rd attempt consumer y -- rollback
and so on until the backout threshold is used and the app is doing something about it.

Enjoy
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Thu Apr 28, 2005 1:19 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Quote:
On broken systems, the message reappears in the queue with a backout counter set to values like 3, 5, 27, 33 and the like.


When I've seen this, it is usually because a backout threshold is supplied but there is no backout queue. You can also get this if you have both the threshold and queue and nothing to actually move the message.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Thu Apr 28, 2005 7:27 pm    Post subject: Reply with quote

Grand High Poobah

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

Also I would not use ConnectionConsumer.stop() to stop delivering the message.

To stop delivering the message use Connection.stop().

Then you can close the Consumer, close the Session and finally close the Connection....

Enjoy
Back to top
View user's profile Send private message Send e-mail
griffel
PostPosted: Fri Apr 29, 2005 12:20 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2005
Posts: 23

Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 29, 2005 10:31 am    Post subject: Reply with quote

Grand High Poobah

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

Back to top
View user's profile Send private message Send e-mail
griffel
PostPosted: Fri Apr 29, 2005 8:37 pm    Post subject: Reply with quote

Novice

Joined: 22 Mar 2005
Posts: 23

Might be a bit too early today for me to grasp some clear thought, but:
I understood that you suggested to avoid further message delivery by calling Connection.stop() first (instead of ConnectionConsumer.stop()).
And that's exactly my original code sequence shown in the quoted mail thread. But thnx for giving me a chance to discuss this, anyway.

Live long and prosper.
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 » ConnectionConsumer producing wrong backout counts?
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.