Author |
Message
|
mbtech |
Posted: Tue May 07, 2013 7:21 pm Post subject: Queue full or not found |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
I have a scenario where i need to throw an user defined exception message when the quue is full or not found.May i know how to handle it in ESQL |
|
Back to top |
|
 |
anurag.munjal |
Posted: Tue May 07, 2013 8:44 pm Post subject: |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
|
Back to top |
|
 |
smdavies99 |
Posted: Tue May 07, 2013 11:03 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
anurag.munjal wrote: |
Ever Heard of Dead Letter Queue? Queue Depth Events?
[/url] |
Neither of which apply to a Queue Not Found situation when you are trying to open it for Input or Output*. The DLQ will only come into play if you are moving data between QMGRS and a destination queue is missing. As far as the application goes, the message has been sent ok.
If you try to open a Queue that does not exist, I'd fully expect WMQ to return a 2085 error. You can detect the exact WMQ Error you get in any sitation by examainnig the ExceptionList.
*I can't remember what error you get when using an Alias Q and the target isn't there. _________________ 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 |
|
 |
anurag.munjal |
Posted: Wed May 08, 2013 1:01 am Post subject: |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
|
Back to top |
|
 |
Esa |
Posted: Wed May 08, 2013 3:14 am Post subject: Re: Queue full or not found |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
mbtech wrote: |
I have a scenario where i need to throw an user defined exception message when the quue is full or not found.May i know how to handle it in ESQL |
You need to declare an ESQL continue handler. You cannot use the default propagation, you must propagate explicitly and declare a continue handler for that line of code. You may need to examine which the return codes to catch if you need to throw an exception only the the queue is full or cannot be found, but not when it's put inhibited, for example. |
|
Back to top |
|
 |
mbtech |
Posted: Thu May 09, 2013 4:22 am Post subject: Queue handling |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
Can any1 send the code to handle the queue when it is full or not found? |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 09, 2013 5:03 am Post subject: Re: Queue handling |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mbtech wrote: |
Can any1 send the code to handle the queue when it is full or not found? |
It's the same code as handling any other error, except that part of the logic is to react to those WMQ errors. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mbtech |
Posted: Mon May 13, 2013 8:16 pm Post subject: |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:1073
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQOutputNode
Name:CHARACTER:com/sub/wvsc/bs/wmb/sync/WVSC_Sync_Process#FCMComposite_1_7
Label:CHARACTER:com.sub.wvsc.bs.wmb.sync.WVSC_Sync_Process
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
MessageException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbMqOutputNode.cpp
Line:INTEGER:2186
Function:CHARACTER:ImbMqOutputNode::putMessage
Type:CHARACTER:ComIbmMQOutputNode
Name:CHARACTER:com/sub/wvsc/bs/wmb/sync/WVSC_Sync_Process#FCMComposite_1_7
Label:CHARACTER:com.sub.wvsc.bs.wmb.sync.WVSC_Sync_Process
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2667
Text:CHARACTER:Failed to put message
Insert
Type:INTEGER:2
Text:CHARACTER:-1
Insert
Type:INTEGER:5
Text:CHARACTER:MQW102
Insert
Type:INTEGER:2
Text:CHARACTER:2053
Insert
Type:INTEGER:5
Text:CHARACTER:
Insert
Type:INTEGER:5
Text:CHARACTER:
Insert
Type:INTEGER:5
Text:CHARACTER:OUT
I need to handle 2053 MQ full with a user exception?
Code: |
DECLARE rExeList REFERENCE TO InputExceptionList.*[1];
IF rExeList.MessageException.Number = '2066' THEN
SET rOutCrtprsResp.STATUS VALUE = 'QUEUE IS FULL';
PROPAGATE TO TERMINAL 'out';
THROW USER EXCEPTION MESSAGE 1119 VALUES ('QUEUE FULL OR DOWN');
END IF; |
the queue full error is not handling through this code could any one let me know how to handle this?[/quote] |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon May 13, 2013 9:54 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
What does the usertrace say when you encounter this error?
Are you sure that you are correctly navigating the ExceptionList?
If I recall correctly there is an article on DeveloperWorks about the correct way to do this. _________________ 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 |
|
 |
zpat |
Posted: Mon May 13, 2013 11:29 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I believe WMB does use the DLQ as a backout queue if there is not a backout queue defined on the input queue (assuming the message flow is transactional).
We certainly get loads of messages on the DLQ (in testing) with MQRC 2053 (queue full) in the DLH and they have come from WMB. |
|
Back to top |
|
 |
mbtech |
Posted: Tue May 14, 2013 3:02 am Post subject: |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
Code: |
DECLARE rExeList REFERENCE TO InputExceptionList.*[1];
IF rExeList.MessageException.Number = '2066' THEN
SET rOutCrtprsResp.STATUS VALUE = 'QUEUE IS FULL';
PROPAGATE TO TERMINAL 'out';
THROW USER EXCEPTION MESSAGE 1119 VALUES ('QUEUE FULL OR DOWN');
END IF; |
Please let me know anything to add for this code to handle queue not found or queue full errors.
I had already attached a reference of exception list when the queue is full.
Last edited by mbtech on Tue May 14, 2013 3:10 am; edited 2 times in total |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue May 14, 2013 3:08 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Code: |
C:\Program Files\IBM\MQSI\7.0>mqrc 2085
2085 0x00000825 MQRC_UNKNOWN_OBJECT_NAME
C:\Program Files\IBM\MQSI\7.0>mqrc 2053
2053 0x00000805 MQRC_Q_FULL
C:\Program Files\IBM\MQSI\7.0>
|
May I humbly suggest that you are looking at the wrong bit of the ExceptionList (as I hinted before) _________________ 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 |
|
 |
Esa |
Posted: Tue May 14, 2013 4:23 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
You are supposed to thow an user defined exception if the queue is full or not found.
Why are you examining exception lists? It's like starting to look for a toilet when you already have the brown stuff in your trousers.
Why don't you do something like this:
Code: |
BEGIN
DECLARE EXIT HANDLER FOR SQLSTATE LIKE'MQ%'
BEGIN
IF SQLNATIVEERROR = 2066 THEN
THROW USER EXCEPTION MESSAGE 1119 VALUES ('QUEUE FULL');
END IF;
IF SQLNATIVEERROR = <something> THEN
THROW USER EXCEPTION MESSAGE 1119 VALUES ('QUEUE DOES NOT EXIST');
END IF;
END;
PROPAGATE;
END;
RETURN FALSE; |
|
|
Back to top |
|
 |
mbtech |
Posted: Tue May 14, 2013 9:04 pm Post subject: |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
Iam Coding like this by capturing 2053 error is it the right way?Does message exception have an order that the error code will be in the third insert?
Code: |
IF rExeList.MessageException.Insert[3].Text = '2053' THEN
SET rOutCrtPlnResp.STATUS VALUE = 'QUEUE IS DOWN';
PROPAGATE TO TERMINAL 'out';
THROW USER EXCEPTION MESSAGE 1119 VALUES ('Exception in Queue');
|
@ESA: seems SQLSTATECODE is for databases not for MQs
Let me know if iam wrong? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue May 14, 2013 10:15 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I will say it one final time,
you are traversing the ExceptionList incorrectly.
What happens if the WMQ error code is not at element [3]? Then your hard coded ESQL will fail miserably. _________________ 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 |
|
 |
|