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 » WebSphere Message Broker (ACE) Support » MQGet node leaving queue connection open?

Post new topic  Reply to topic
 MQGet node leaving queue connection open? « View previous topic :: View next topic » 
Author Message
chrisc
PostPosted: Mon Sep 21, 2009 11:41 pm    Post subject: MQGet node leaving queue connection open? Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

Hi everyone,

We're running Message Broker 6.1 on z/OS.

I have a couple of flows that are doing a couple of timer-based MQGets from a queue in order to offer a retry capability.

It's not specifically related to my question, but for background, this is the section of the flow in question:
- The basic flow has a request queue. If certain failures occur during processing it moves the message to a "hold" queue for retrying later.
- A TimeoutNotification node is set to fire a message every 10 minutes
- This is hooked up to an MQGet node that reads from a "hold" queue
- Out/warning is then hooked up to an MQOutput node that writes to a "retry" queue. This node is hooked back up to the initial MQGet, so it will loop as long as there are messages.
- The "no message" terminal on the MQGet node is hooked up to a second MQGet / MQOutput node combination that reads from the "retry" queue and writes the messages found to the flow's main request queue, looping until "no message" occurs.

This two-step process is so we can prevent retried messages zipping through and ending up on the "hold" queue while we're still processing them, which could result in infinite loops etc. We wanted to avoid using sentinel messages or message content flags to indicate the end of a run, hence the two queue approach.


...but anyway...!


This is all working nicely MOST of the time, but occasionally when I deploy this flow to the broker I get endless MQRC 2042 messages (object in use) indicating that the "hold" queue is in use by something. It generates a couple of messages per second, seemingly forever.

The only thing reading from this queue is this flow, which implies that the Broker is doing some sort of connection pooling thing and not releasing the connection when it's done.


Does anybody have any info about how this works?
How can we ensure that we don't get 2042 messages if we redeploy into an environment?
Can we force the MQGet node to close the connection after reading a message? Or can we explicitly close it after we've finished a retry run?

I'm thinking we might need to do something like remove the flow, wait till the connections expire (however long that is) then try again? It all seems a bit flakey. It's disappointing that the broker doesn't recognise that the flow being deployed is replacing the flow that used to have the connection to that queue open.


Any thoughts or insights would be appreciated. Sorry for the long post.


Many thanks
Chris
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Sep 22, 2009 3:06 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's a bad idea to wire nodes in a loop.

Use propagate instead.

If this MQGet node is the only thing that is reading from the queue, Broker should be closing it and releasing the connection when you redeploy.

You may have an instance of the flow in progress at the time of deploy, though. Deployment won't happen until that instance completes.
Back to top
View user's profile Send private message
chrisc
PostPosted: Tue Sep 22, 2009 4:27 pm    Post subject: Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

Hi mqjeff,

I normally steer well clear of wiring nodes in a loop but I'm not sure how I could do it differently. Propagate is fine when you're pushing data, but in this case I'm pulling data with the MQGet and it either works (going out the out or warning terminals) or it doesn't (going out the failure or no-message terminals). I can't do an MQGet in ESQL.

Thanks for your comments though, that sounds pretty much like I hoped / expected. However, in this case the deployment IS successful, and I get the errors after it has completed, not before.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Sep 22, 2009 9:08 pm    Post subject: Reply with quote

Grand High Poobah

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

chrisc wrote:
Hi mqjeff,

I normally steer well clear of wiring nodes in a loop but I'm not sure how I could do it differently. Propagate is fine when you're pushing data, but in this case I'm pulling data with the MQGet and it either works (going out the out or warning terminals) or it doesn't (going out the failure or no-message terminals). I can't do an MQGet in ESQL.

Thanks for your comments though, that sounds pretty much like I hoped / expected. However, in this case the deployment IS successful, and I get the errors after it has completed, not before.


What's the problem with putting a propagate in your main flow,
reading from the queue with MQGet node in the propagate branch and setting the flag to terminate the loop in the environment?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chrisc
PostPosted: Tue Sep 22, 2009 11:44 pm    Post subject: Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

fjb_saper wrote:
What's the problem with putting a propagate in your main flow,
reading from the queue with MQGet node in the propagate branch and setting the flag to terminate the loop in the environment?


I guess I could, but it doesn't seem to offer anything more than my current approach, wiring preferences aside. Infinite loops in the broker tend to come from loops involving hand-coded exit points (e.g. a flag in the environment) that go wrong or don't cater for all situations, but this wiring approach requires no ESQL code, it all uses the clearly defined features of the nodes that IBM provides.

Maybe I'm missing something in what you're recommending...?

But anyway, this is off the topic of my original post.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Wed Sep 23, 2009 12:48 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

chrisc wrote:

I guess I could, but it doesn't seem to offer anything more than my current approach, wiring preferences aside.


FWIW, this approach isnt just a "preference". Looping at the message flow level increases the demands on the stack and can easily lead to stack overflow errors.
Back to top
View user's profile Send private message
chrisc
PostPosted: Wed Sep 23, 2009 2:43 pm    Post subject: Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

WMBDEV1 wrote:
FWIW, this approach isnt just a "preference". Looping at the message flow level increases the demands on the stack and can easily lead to stack overflow errors.


OK fair enough, I didn't realise that would be the case. I had assumed that because there is no transformation involved, there was nothing that would be added to the stack. I guess it makes sense that there may be other elements that would contribute though.
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 » WebSphere Message Broker (ACE) Support » MQGet node leaving queue connection open?
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.