Author |
Message
|
dosttumhara1810 |
Posted: Fri Jan 06, 2012 5:11 am Post subject: MQGET node de not closes handle on Queue |
|
|
Voyager
Joined: 01 Dec 2010 Posts: 76
|
Hi,
I want to close the handle on Queue after Getting msgs USing MQGET node.
How to do that |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Fri Jan 06, 2012 5:26 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
Why? What is your purpose? Why you don't let broker handle that internally?
--
Marko |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 06, 2012 5:41 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dosttumhara1810 wrote: |
How to do that |
You can't and you shouldn't. As the previous poster indicates, WMQ handles are managed internally by the broker.
The only reason you might want to do this is because you've got a MQGet node wired into a loop and that's causing you to have too many handles open on the affected queue. This can be fixed by correcting your design so the MQGet node isn't in a loop. As well as burning handles, looping an MQGet node tends to bring execution groups down when the storage runs out. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
adrian_ |
Posted: Fri Jan 06, 2012 6:43 am Post subject: |
|
|
Novice
Joined: 06 Jan 2012 Posts: 13
|
try setting on MQGet node transaction mode =no . |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 06, 2012 6:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
adrian_ wrote: |
try setting on MQGet node transaction mode =no . |
Won't change how the handle is managed. Might also have unfortunate effects for the flow's design logic. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jan 06, 2012 6:50 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
adrian_ wrote: |
try setting on MQGet node transaction mode =no . |
Are you sure that will work?
Are you sure that just doing that will close the open connection to the queue?
In order to read something from a queue, you have to open it.
Code: |
The output from MQOPEN is:
A connection handle (Hobj)
A completion code
A reason code
Use the connection handle on subsequent MQI calls.
PLUS
Scope of an object handle
The scope of an object handle (Hobj) is the same as the scope of a connection handle (Hconn).
|
so when you open a queue, you get a handle. You keep the hanldle until you do either an
Or
WMQ Programming 101. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 06, 2012 6:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
so when you open a queue, you get a handle. You keep the hanldle until you do either an
Or
WMQ Programming 101. |
And all buried in the depths of WMB for all the WMQ nodes. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cociu_2012 |
Posted: Fri Jan 06, 2012 7:15 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
Acolyte
Joined: 06 Jan 2012 Posts: 72
|
dosttumhara1810 wrote: |
Hi,
I want to close the handle on Queue after Getting msgs USing MQGET node.
How to do that |
Let Broker handle this internally. This can be achieved by getting your message with MQGet, store it after and return back before the MQ node. This will clean all your memory and will close the connection. See the picture:
[img]http://postimage.org/image/m63hn66if/[/img] |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 06, 2012 7:33 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
cociu_2012 wrote: |
dosttumhara1810 wrote: |
Hi,
I want to close the handle on Queue after Getting msgs USing MQGET node.
How to do that |
Let Broker handle this internally. This can be achieved by getting your message with MQGet, store it after and return back before the MQ node. This will clean all your memory and will close the connection. See the picture:
[img]http://postimage.org/image/m63hn66if/[/img] |
That's a nifty solution, but I don't think it is rock-solid. That is, I don't believe that the product is designed to guarantee the behavior you're taking advantage of.
So yes, it probably works. It might suddenly not work, at of course the exact wrong time, and a PMR would get you little assistance. |
|
Back to top |
|
 |
cociu_2012 |
Posted: Fri Jan 06, 2012 8:08 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
Acolyte
Joined: 06 Jan 2012 Posts: 72
|
mqjeff wrote: |
That's a nifty solution, but I don't think it is rock-solid. That is, I don't believe that the product is designed to guarantee the behavior you're taking advantage of.
So yes, it probably works. It might suddenly not work, at of course the exact wrong time, and a PMR would get you little assistance. |
It's not a probably solution and it works, with no other risks.
Why will not work, what's exactly wrong?
It is actually recommended to use this approach when you'r handling a high volume of messages and performance is at risk.(for example you have to invoke a MQ service that retrieves 5000 messages. (one customer with 5000 subscribers)). |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 06, 2012 8:19 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cociu_2012 wrote: |
It's not a probably solution and it works, with no other risks. |
I admire your certainty. Can you post some evidence to back that? Or links to same?
cociu_2012 wrote: |
Why will not work, what's exactly wrong? |
I don't think (and certainly don't recall seeing it documented anywhere) that going back the way you illustrate is guaranteed to clean up the "rolled back" leg of the flow?
cociu_2012 wrote: |
It is actually recommended to use this approach when you'r handling a high volume of messages and performance is at risk.(for example you have to invoke a MQ service that retrieves 5000 messages. (one customer with 5000 subscribers)). |
Recommended by whom? You certainly need to post a link for that.
If I had a requirement to retrieve 5000 subscription messages for 1 customer that's not the 1st recommendation I'd make to a client. Especially given the issues with the MQGet node repeatedly used in a single flow. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Esa |
Posted: Fri Jan 06, 2012 8:35 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
cociu_2012 wrote: |
mqjeff wrote: |
That's a nifty solution, but I don't think it is rock-solid. That is, I don't believe that the product is designed to guarantee the behavior you're taking advantage of.
So yes, it probably works. It might suddenly not work, at of course the exact wrong time, and a PMR would get you little assistance. |
It's not a probably solution and it works, with no other risks.
Why will not work, what's exactly wrong?
It is actually recommended to use this approach when you'r handling a high volume of messages and performance is at risk.(for example you have to invoke a MQ service that retrieves 5000 messages. (one customer with 5000 subscribers)). |
I think you are confusing things. Yes, you are describing the recommended solution - from memory handling point of view. But it does not (necessarily) have anything to do with closing the queue. Did you check that Open Input Count for the MQGet queue is 0 after the flow has read messages from it?
Message Broker keeps open queue handles in execution group level Open Handle Cache, the default size of is 10 (used to be 50 in V5).
You can change the size with mqsichangeproperties, if I remember correctly (but you cannot find this in the infocenter).
Setting the Open Handle Cache size to 1 would probably force the EG to close the queue after each get. I have not tested it. I cannot be bothered with testing silly ideas. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 06, 2012 8:44 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Esa wrote: |
Yes, you are describing the recommended solution - from memory handling point of view. |
Who's recommending this? Is it a developerWorks article? Anyone?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Esa |
Posted: Fri Jan 06, 2012 9:02 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Vitor wrote: |
Esa wrote: |
Yes, you are describing the recommended solution - from memory handling point of view. |
Who's recommending this? Is it a developerWorks article? Anyone?  |
We are. I think he is describing how to use MQGet to read several messages within a loop. At least I would recommend looping in the compute node and propagating to MQGet within the loop. Instead of wiring the output terminal back to the previous compute nodes input terminal, which could have catastrofic consequenses. That is what I meant when I said he is describing a recommended solution. A bit off-topic, though. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 06, 2012 9:09 am Post subject: Re: MQGET node de not closes handle on Queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Ok; the way it was written sounded like it was an IBM (or other) published recommendation.
My misgivings about it remain, and I look forward to the justification of the poster's confidence. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|