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 Java / JMS » MQRCCF_COMMAND_LENGTH_ERROR when using MQCACF_COMMAND_SCOPE

Post new topic  Reply to topic
 MQRCCF_COMMAND_LENGTH_ERROR when using MQCACF_COMMAND_SCOPE « View previous topic :: View next topic » 
Author Message
deliego
PostPosted: Wed Jun 16, 2021 10:17 am    Post subject: MQRCCF_COMMAND_LENGTH_ERROR when using MQCACF_COMMAND_SCOPE Reply with quote

Newbie

Joined: 16 Jun 2021
Posts: 5

Hi everyone,

I currently have this code, which works when I run it against a QM member in a QSG on MQ 9.2.0, but fails when I run it on another QM in a QSG on MQ 9.0.0.

The error I get is 3230: Code: MQCC_FAILED, Reason: MQRCCF_COMMAND_LENGTH_ERROR

But if I remove this line:
Code:
pcfMessageRequest.addParameter(MQConstants.MQCACF_COMMAND_SCOPE, "*");

then it works fine on 9.0.0

Code:

        PCFMessage pcfMessageRequest = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q_NAMES);
        pcfMessageRequest.addParameter(MQConstants.MQCA_Q_NAME, "*");
        pcfMessageRequest.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL);
        pcfMessageRequest.addParameter(MQConstants.MQCACF_COMMAND_SCOPE, "*");

        try {
            PCFMessage[] pcfMessageResponses = pcfMessageAgent.send(pcfMessageRequest);

            for (PCFMessage response : pcfMessageResponses) {
                    String[] queueNames = response.getParameter(MQConstants.MQCACF_Q_NAMES).getStringValue().split("\n");
                    for (String queueName : queueNames) {
                        queuesResult.add(queueName.trim());
                    }

                }
            }
        } catch (MQDataException ex) {
            String errorMessage = String.format("Code: %s, Reason: %s",
                    MQConstants.lookupCompCode(ex.getCompCode()),
                    MQConstants.lookupReasonCode(ex.getReason()));
            logger.error("Could not inquire queue names for *. " + errorMessage);
        }


So why would it complain about the command being so large just by adding the command scope "*"?

Also, I am using com.ibm.mq.allclient:9.2.2.0

Any help is much appreciated.

Thanks!
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Jun 18, 2021 12:11 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

The command server is really picky about the order of parameters. The MQ Knowledge Center for Inquire Queue Names shows that CommandScope should be the 2nd parameter.

Try the following:
Code:
PCFMessage pcfMessageRequest = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q_NAMES);
pcfMessageRequest.addParameter(MQConstants.MQCA_Q_NAME, "*");
pcfMessageRequest.addParameter(MQConstants.MQCACF_COMMAND_SCOPE, "*");
pcfMessageRequest.addParameter(MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL);

PCFMessage[] pcfMessageResponses = pcfMessageAgent.send(pcfMessageRequest);


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
deliego
PostPosted: Fri Jun 18, 2021 12:42 pm    Post subject: Reply with quote

Newbie

Joined: 16 Jun 2021
Posts: 5

I did not know that there was a specific order for these parameters

I will try your suggestion and post an update.

Thanks!
Back to top
View user's profile Send private message
deliego
PostPosted: Thu Jun 24, 2021 5:04 am    Post subject: Reply with quote

Newbie

Joined: 16 Jun 2021
Posts: 5

That solved it. Thanks!
Back to top
View user's profile Send private message
deliego
PostPosted: Mon Aug 16, 2021 8:57 am    Post subject: Reply with quote

Newbie

Joined: 16 Jun 2021
Posts: 5

Looks like I spoke too soon, and according to IBM's doc here:
https://www.ibm.com/docs/en/ibm-mq/9.0?topic=formats-inquire-queue-names

Quote:
"When a value other than blank is specified, the maximum response size is limited to 32KB from each queue manager. If the response from a queue manager would be larger than this, an error response with reason code MQRCCF_COMMAND_LENGTH_ERROR (3230) is returned by that queue manager."


Does anyone know of a workaround to this limit?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Aug 16, 2021 10:22 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

From the URL you posted:
Quote:
When a value other than blank is specified, the maximum response size is limited to 32KB from each queue manager. If the response from a queue manager would be larger than this, an error response with reason code MQRCCF_COMMAND_LENGTH_ERROR (3230) is returned by that queue manager.

One of the qmgrs is returning more than 32K in violation of the 32K limit. You may need to modify your app to request only from a subset of QMs per inquire call.

Out of curiosity, how many qmgrs in the QSG? How many queues? Anything in the qmgr syslog at the time of the r/c 3230?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
deliego
PostPosted: Tue Aug 17, 2021 5:36 am    Post subject: Reply with quote

Newbie

Joined: 16 Jun 2021
Posts: 5

I ended up making two calls, one for all regular queue names, and the other for queues with QSG_DISP = SHARED to get only the shared ones.

There are 4 QMs as part of the same QSG. They range from 445 to 660 queues each.

Thanks!
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 Java / JMS » MQRCCF_COMMAND_LENGTH_ERROR when using MQCACF_COMMAND_SCOPE
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.