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 » IBM MQ API Support » MQGET failing on xmitq

Post new topic  Reply to topic
 MQGET failing on xmitq « View previous topic :: View next topic » 
Author Message
moe
PostPosted: Mon Apr 09, 2007 9:43 pm    Post subject: MQGET failing on xmitq Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Hello,

I'm trying to perform a get operation on a local queue which has been defined with usage(xmitq) however the get operation is failing with rc 2016 (get disabled).

Here are snippets of the source code:

Code:

  oOptions = MQOO_INPUT_SHARED;
  md.Version = MQMD_VERSION_2;
  strncpy(od.ObjectName, c->xmitQueue, (size_t)MQ_Q_NAME_LENGTH);

  ...

  gmo.Version = MQGMO_VERSION_2;
  gmo.Options = MQGMO_NO_WAIT;
  gmo.MatchOptions = MQMO_MATCH_CORREL_ID;

  ...

  MQOPEN(hConn, &od, oOptions, &hObj, &openCode, &reason);

  ...

  memcpy(md.MsgId, MQMI_NONE, sizeof(md.MsgId));
  memcpy(md.CorrelId, pCorrelId, sizeof(md.CorrelId));

  ...

  MQGET(hConn, hObj, &md, &gmo, bufLen, pBuffer, &messlen, &compCode, &reason);



Through runmqsc I get(enabled) the queue then ran the code again but it seems mqseries is get disabling the queue itself After running the code the queue is get(disabled). I've been browsing the documentation all day and havent been able to pin point it, the strange thing is that I dont get this behaviour performing MQGET's on SCTQ.

Checking in the doco, get operations are inhibited if:

If get operations are inhibited for a queue from which you are attempting to get messages (or any queue to which the queue name resolves), the MQGET call fails and returns the MQRC_GET_INHIBITED reason code. This happens even if you are using the MQGET call for browsing. You may be able to get a message successfully if you attempt the MQGET call at a later time, if the design of the application is such that other programs change the attributes of queues regularly.

Code:
dis ql(XRMT1)
     4 : dis ql(XRMT1)
AMQ8409: Display Queue details.
   DESCR(WebSphere MQ Default Local Queue)
   PROCESS( )                              BOQNAME( )
   INITQ(SYSTEM.CHANNEL.INITQ)             TRIGDATA( )
   CLUSTER( )                              CLUSNL( )
   QUEUE(XRMT1)                            CRDATE(2007-04-10)
   CRTIME(02.14.17)                        ALTDATE(2007-04-10)
   ALTTIME(05.37.26)                       GET(DISABLED)
   PUT(ENABLED)                            DEFPRTY(0)
   DEFPSIST(NO)                            MAXDEPTH(5000)
   MAXMSGL(4194304)                        BOTHRESH(0)
   SHARE                                   DEFSOPT(SHARED)
   HARDENBO                                MSGDLVSQ(PRIORITY)
   RETINTVL(999999999)                     USAGE(XMITQ)
   NOTRIGGER                               TRIGTYPE(FIRST)
   TRIGDPTH(1)                             TRIGMPRI(0)
   QDEPTHHI(80)                            QDEPTHLO(20)
   QDPMAXEV(ENABLED)                       QDPHIEV(DISABLED)
   QDPLOEV(DISABLED)                       QSVCINT(999999999)
   QSVCIEV(NONE)                           DISTL(YES)
   NPMCLASS(NORMAL)                        DEFTYPE(PREDEFINED)
   TYPE(QLOCAL)                            SCOPE(QMGR)
   DEFBIND(OPEN)                           IPPROCS(0)
   OPPROCS(0)                              CURDEPTH(9)


Please help!
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Apr 09, 2007 11:12 pm    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

It is normal for an xmitq to be get disabled when the channel is stopped. The channel is enabled again when the channel starts. This takes place automatically inside the MCA.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 09, 2007 11:51 pm    Post subject: Re: MQGET failing on xmitq Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

moe wrote:
I'm trying to perform a get operation on a local queue which has been defined with usage(xmitq) however the get operation is failing with rc 2016 (get disabled).


On a side topic, why are you performing any opperation yourself on a xmitq? These should be left to the good graces of the MCAs and the queue manager.

(Or possibly some admin commands / explorer use in error circumstances)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
moe
PostPosted: Mon Apr 09, 2007 11:59 pm    Post subject: Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Im just exploring the ins and outs of mq intercommunication and how messages look as they are transmitted through mqseries.

Looking at Nigelg's response, i'll probably run a pcf command to get(enable) the queue prior to performing any operations on it, then get(disable) it again once completed.

I'll post back when I have some results.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 10, 2007 12:08 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

moe wrote:
Im just exploring the ins and outs of mq intercommunication and how messages look as they are transmitted through mqseries.


I'll save you some time. Messages on an xmitq look like the messages you sent with an xmit header attached. You'll find the format in the Application Programming Reference.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Nigelg
PostPosted: Tue Apr 10, 2007 3:31 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Not quite.

If any msgs are supplied by the app with an MD v2 with non-default v2 fields, the msg on the xmitq will have an MDE header after the XQH header and before the user data.

This is because the embedded MD in the XQH, the MD the app supplied, is only a v1 MD.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
moe
PostPosted: Tue Apr 10, 2007 4:56 pm    Post subject: Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Thanks guys, for now i've learnt all I can without going insane, LOL
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 10, 2007 5:57 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

moe wrote:
Thanks guys, for now i've learnt all I can without going insane, LOL


We are all mad here.
_________________
I am *not* the model of the modern major general.
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 » IBM MQ API Support » MQGET failing on xmitq
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.