Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic queues and effect on apps 1

Status
Not open for further replies.

rbaltroc

Technical User
May 8, 2003
3
US
Hi Guys,

Wonder if anyone can help with a query? I'm using MQseries 5.2 on a HPUX11 platform.

I've noticed that dynamic queues are sometimes left behind when an application program issues an MQOPEN call to open a queue. Dynamic queues should be deleted when the app closes the queue or terminates, BUT, if there are any uncommitted MQ calls calls outstanding against the queue at this time, the queue is marked as being logically deleted, but is actually only physically deleted.

My question is, does anything need to be done to clear these dynamic queues? If they fill up, will MQ calls made to that queue still succeed or will they fail?

Thanks in advance!
 
Do you mean Temporary Dynamic or Permanent Dynamic queues? If temporary, the queue will always be deleted when it is closed and all messages lost. If permanent, it will only be deleted if you specify an MQCLOSE option to delete it. Otherwise it will stay forever.

I haven't specifically tried this but, according to the manual, if a permanent dynamic queue is closed with uncommitted gets or puts outstanding, the MQCLOSE will fail with MQRC_OPTION_NOT_VALID_FOR_TYPE and the queue will not be deleted.

Cheers,
Paul
 
Thanks for the response Paul.

It's permanent dynamic queues that I'm talking about. There's no MQCLOSE specified so the queue stays (at least until the queue manager is restarted). What also seems to happen is that uncommitted gets or puts leave messages on the temporary queue. Is this normal? What happens if the number of messages on the temporary queue exceeds the MAXDEPTH?

Thanks again.
 
A permanent dynamic queue will never be deleted unless it is explicitly deleted or an MQCLOSE with one of the MQCO_DELETE* options is specified.

Uncommitted Units of Work are backed out if the program ends abnormally or are automatically committed if the program ends cleanly (depending upon the platform).

What do you mean by 'temporary queue'? The only temp queues are temp dynamic but you are using permanent dynamic ones, aren't you?

The number of messages can never exceed the max depth of a queue (unless max depth is reduced while there are messages on the queue!)

Cheers,
Paul
 
Sorry, "temporary queue" was a typing error. Or maybe a thinking error! I meant dynamic queue, amd yes it's permanent dynamic ones.

So what happens if the permanent dynamic queue fills up, will an app that's trying to MQPUT to that queue terminate? I guess it depends on the app. I know that my app falls over if it tries to MQPUT to a non dynamic queue which is at MAXDEPTH, but in this case the queue has been configred as permanent dynamic so I'm trying to work out if the app will still fall over or whether it being a dyanmic queue solves the issue.

Perhaps I need to get back a step here... what's the reason for having a permanent dynamic queue rather than just a standard local queue?

Thanks again for the info.



 
With regard to queues reaching max depth, all (local) queues behave in the same way. As soon as an MQPUT is issued which would exceed the Max Depth, RC 2053 will be returned and the MQPUT will fail. Note that the number of messages counted here includes uncommitted puts. You can verify this by putting a message on a queue but not committing it - check the Queue Depth - it will show the message as being there but if you try to MQGET the message it won't yet exist.

Don't confuse 'dynamic' with 'temporary'. The only real difference between a predefined and perm dynamic queue is that the perm dynamic can be deleted by an MQCLOSE. Other than that, it is as permanent as any other queue.

So why would you use one? Generally, if you only need a dynamic queue for a specific MQ session and used only be one process (e.g. Reply-to queue), use a temp dynamic queue.

If you need a dynamic queue that you may need to keep across MQ sessions or share with other processes, use a perm dynamic.

Of course these are only rough rules of thumb, as ever.

HTH,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top