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 » Queue full or not found

Post new topic  Reply to topic Goto page 1, 2  Next
 Queue full or not found « View previous topic :: View next topic » 
Author Message
mbtech
PostPosted: Tue May 07, 2013 7:21 pm    Post subject: Queue full or not found Reply with quote

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
View user's profile Send private message
anurag.munjal
PostPosted: Tue May 07, 2013 8:44 pm    Post subject: Reply with quote

Voyager

Joined: 08 Apr 2012
Posts: 97

Ever Heard of Dead Letter Queue? Queue Depth Events?
check out http://www.mqseries.net/phpBB2/viewtopic.php?t=51970&sid=03ee69b1f8d58b19fb2c548a074a27c8
AND

[url] http://stackoverflow.com/questions/876137/what-is-the-difference-between-a-dead-letter-queue-and-a-back-out-queue[/url]
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue May 07, 2013 11:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
anurag.munjal
PostPosted: Wed May 08, 2013 1:01 am    Post subject: Reply with quote

Voyager

Joined: 08 Apr 2012
Posts: 97

Thanks for the correction!


So are you suggesting to let the Broker Create a default exception list, and then look for the error number (2085 as you stated) and then throw a user defined exception?


FYI: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqsao.doc%2Ffm12810_1.htm[/url]
Back to top
View user's profile Send private message
Esa
PostPosted: Wed May 08, 2013 3:14 am    Post subject: Re: Queue full or not found Reply with quote

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
View user's profile Send private message
mbtech
PostPosted: Thu May 09, 2013 4:22 am    Post subject: Queue handling Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu May 09, 2013 5:03 am    Post subject: Re: Queue handling Reply with quote

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
View user's profile Send private message
mbtech
PostPosted: Mon May 13, 2013 8:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Mon May 13, 2013 9:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Mon May 13, 2013 11:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
mbtech
PostPosted: Tue May 14, 2013 3:02 am    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Tue May 14, 2013 3:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Esa
PostPosted: Tue May 14, 2013 4:23 am    Post subject: Reply with quote

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
View user's profile Send private message
mbtech
PostPosted: Tue May 14, 2013 9:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Tue May 14, 2013 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Queue full or not found
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.