Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:30:00+00:00 2026-06-13T22:30:00+00:00

I am trying to receive the message from the queue using ANSI-C and MQGET

  • 0

I am trying to receive the message from the queue using ANSI-C and MQGET function. The problem is that I always get error 2010 (MQRC_DATA_LENGTH_ERROR).

I found out that this error concerns parameter 7 of the MQGET call (DataLength). The message on my queue has 7157460 bytes. The channel I am using for MQGET has the “Maximum message length” set to 104857600 (as well as the queue holding the message).

I am even using the MQGET from this example:
http://www.capitalware.biz/dl/code/c/msg2file.zip

And I still end up with error 2010. What am I doing wrong? Should I somehow increase the maximum size of the message in MQSERVER environment variable?

MQGET call:

/* ... */
MQLONG   messlen;            /* message length received       */

MQGET(Hcon,                  /* connection handle                 */
        Hobj,                /* object handle                     */
        &md,                 /* message descriptor                */
        &gmo,                /* get message options               */
        buflen,              /* pBuffer length                    */
        pBuffer,             /* pointer to message buffer         */
        &messlen,            /* message length                    */
        &CompCode,           /* completion code                   */
        &Reason);            /* reason code                       */
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:30:01+00:00Added an answer on June 13, 2026 at 10:30 pm

    I’ve got it! The answer is to use MQCONNX call to connect to queue manager.

    Example:

    #include <cmqxc.h>
    /* ... */
    MQCNO   mqcno = {MQCNO_DEFAULT} ; /* Connection options */
    MQCD    mqcd  = {MQCD_CLIENT_CONN_DEFAULT};  /* Channel Defs */
    
    /* ... */
    mqcd.MaxMsgLength = 104857600L; /* 100 MB */
    
    MQCONNX(mQueueManager.Name,
         &mqcno,
         &mQueueManager.ConnectionHandle,
         &mQueueManager.CompletionCode,
         &mQueueManager.ReasonCode);
    

    It worked like a charm!

    But please remember – if you find yourself needing to increase the maximum message size – think twice. There is probably something wrong with the design. In another words – MQ should not be used for transferring big messages. MQ File Transfer Edition is one of the solutions then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to receive some data from a client in a server using Google
I'm trying to receive the shouldStartLoadWithRequest message from a WebView in an applescript/objective-c OSX
I am trying to receive a json object back from php after sending data
I am trying to receive an image from the Android Gallery via an ACTION_SEND
I seem to be getting this particular always when i am trying to receive
I receive the following error when trying to run my ASP.NET MVC application: The
i receive the following error when trying to implement auto-complete based on edismax type.
I'm trying to send and receive using pipes: send.cpp struct { long a; long
I am trying to develop the XMPP Gateway which can send/receive from standard XMPP
I'm trying to publish messages to RabbitMQ, from a Ruby script (using Bunny )

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.