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 » General IBM MQ Support » MQRC_ Errors when getting messages from iSeries

Post new topic  Reply to topic
 MQRC_ Errors when getting messages from iSeries « View previous topic :: View next topic » 
Author Message
plivingstone
PostPosted: Tue Jun 30, 2015 2:20 am    Post subject: MQRC_ Errors when getting messages from iSeries Reply with quote

Novice

Joined: 11 Nov 2014
Posts: 11

We are using the below code to and settings to connect to the IBM WebSphere MQ (version IBM(R) WebSphere(R) MQ V6.0.1) on an iSeries.

We use the same uid and pwd for three different applications against the same MQ

We get MQRC_NOT_AUTHORIZED and MQRC_Q_MGR_NOT_AVAILABLE errors intermittently throughout the day, but always on the Get messages method.

Settings:

connection properties
:

Quote:
MQC.TRANSPORT_PROPERTY = MQC.TRANSPORT_MQSERIES_MANAGED
MQC.CHANNEL_PROPERTY = SYSTEM.DEF.SVRCONN
MQC.HOST_NAME_PROPERTY = IP Address


We use the below Open Options:

Quote:
MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE


Code:
    class WebSphereMQ
    {
        public bool impStatus { get; set; }

        public MQQueueManager gMQQueueManager;
        public MQQueue gMQQueue;
        private MQMessage queueGetMessage { get; set; }
        private MQGetMessageOptions queueGetMessageOptions { get; set; }

        public MQQueueManager pMQQueueManager;
        public MQQueue pMQQueue;
        private MQMessage queuePutMessage { get; set; }
        private MQPutMessageOptions queuePutMessageOptions { get; set; }

        public WebSphereMQ()
        {
            impStatus = impersonation.impersonateValidUser(Common.impNme, "", Common.impPwd);

            gMQQueueManager = null;
            gMQQueue = null;

            if (gMQQueue != null && gMQQueue.IsOpen)
            {
                // Just incase
                gMQQueue.Close();
                gMQQueueManager.Disconnect();
            }
        }

        public bool connectMQGet(string QMgr, string QName, Hashtable connectionProperties, bool BrowseOnly, string QType)
        {
            try
            {
                gMQQueueManager = new MQQueueManager(QMgr, connectionProperties);
                if (gMQQueueManager != null && QType == "OUT")
                {
                    if (BrowseOnly)
                        gMQQueue = gMQQueueManager.AccessQueue(QName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE);
                    else
                        gMQQueue = gMQQueueManager.AccessQueue(QName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE);
                }
            }
            catch (MQException mqe)
            {
                if (impStatus) impersonation.undoImpersonation();
                /* Write to log */
                Common.logBuilder("WebSphereMQ --> connectMQGet <--", "MQException", Common.ActiveMQ, mqe.Message, "Exception");
                /* Send email to support */
                emailer.exceptionEmail(mqe);
                return false;
            }
            return true;
        }


Here is an example of the error and stack trace:

Quote:
An MQException has happened on 30 June 2015 at 08:52A
Message ---
MQRC_NOT_AUTHORIZED
HelpLink ---
Source ---
amqmdnet
StackTrace ---
at IBM.WMQ.MQBase.throwNewMQException() at IBM.WMQ.MQQueueManager.Connect(String queueManagerName) at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties) at EvryCardManagement.WebSphereMQ.connectMQGet(String QMgr, String QName, Hashtable connectionProperties, Boolean BrowseOnly, String QType)


So is there some setting I can change on the client side to prevent us getting these exceptions, or is this something that needs to be modified on the iSeries/MQ?

Should we try using different uid's for the three different applications hitting the MQ?
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Jun 30, 2015 3:53 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Seems unlikely that "not authorised" would be intermittent.

However make sure you use supported levels of the MQ client and the MQ server.

V6 of MQ is way out of date.

Enable authorisation events to see more details of what is not being allowed (in the SYSTEM.ADMIN.QMGR.EVENT queue).
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
plivingstone
PostPosted: Tue Jun 30, 2015 5:15 am    Post subject: Reply with quote

Novice

Joined: 11 Nov 2014
Posts: 11

zpat wrote:
Seems unlikely that "not authorised" would be intermittent.

However make sure you use supported levels of the MQ client and the MQ server.

V6 of MQ is way out of date.

Enable authorisation events to see more details of what is not being allowed (in the SYSTEM.ADMIN.QMGR.EVENT queue).


Thanks. We seem to get these exceptions about every 30 minutes...

I will ask if we can enable the authorisation events
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 » General IBM MQ Support » MQRC_ Errors when getting messages from iSeries
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.