|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Newbie help with a get |
« View previous topic :: View next topic » |
Author |
Message
|
JamesD |
Posted: Fri May 19, 2006 1:35 pm Post subject: Newbie help with a get |
|
|
Newbie
Joined: 17 May 2006 Posts: 6
|
Hello, I am a new user. I have client and server on 2 XP boxes. I have connectivity and I can PUT and GET messages from each box. I am trying to write a 'C' program to GET a message from the queue from the client using the IBM example and some info gathered here (code below) But I have been unsuccessful. Can someone take a look? It is probably some stupid error. I am getting the 2079 error message
Thanks,
Jim
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* includes for MQI */
#include <cmqc.h>
#include "C:\MQClient\Tools\c\include\cmqxc.h"
int main()
{
/* Declare MQI structures needed */
MQOD mqod = {MQOD_DEFAULT}; /* Object Descriptor */
MQMD mqmd = {MQMD_DEFAULT}; /* Message Descriptor */
MQGMO mqgmo = {MQGMO_DEFAULT}; /* get message options */
/** note, sample uses defaults where it can **/
MQCNO mqcno = {MQCNO_DEFAULT}; /*Connection Options*/
MQCD mqcd = {MQCD_CLIENT_CONN_DEFAULT}; /*Client Connection*/
MQHCONN hConn; /* connection handle */
MQHOBJ hObject; /* object handle */
MQLONG iOpenOptions; /* MQOPEN options */
MQLONG iCompCode; /* completion code */
MQLONG iReason; /* reason code for MQCONN */
MQBYTE buffer[1000]; /* message buffer */
MQLONG buflen; /* buffer length */
MQLONG iMessageLength; /* message length received */
MQCHAR48 qmgrName; /* queue manager name */
mqcno.Version = MQCNO_VERSION_2;
mqcno.ClientConnPtr = &mqcd;
mqcd.TransportType=MQXPT_TCP;
mqcd.ChannelType=MQCHT_CLNTCONN;
strcpy(qmgrName, "QM_oa_degas");
strcpy(mqcd.ChannelName ,"SYSTEM.DEF.SVRCONN");
strcpy(mqcd.ConnectionName ,"192.168.0.7(1414)");
printf("Sample AMQSGET0 start\n");
/******************************************************************/
/* */
/* Connect to queue manager */
/* */
/******************************************************************/
MQCONNX(qmgrName, /* queue manager */
&mqcno, /*connection options*/
&hConn, /* connection handle */
&iCompCode, /* completion code */
&iReason); /* reason code */
/* report reason and stop if it failed */
if (iCompCode == MQCC_FAILED)
{
printf("MQCONN ended with reason code %d\n", iReason);
return (iReason );
} |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri May 19, 2006 4:06 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
2079 means a message bigger than the buffer you specified was pulled off of the queue, and the part of the message that you couldn't fit was truncated.
Code: |
MQBYTE buffer[1000]; /* message buffer */
|
Make that big enough to hold your expected message.
Use this link to search. It will help you lots:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp
Check out the section called "Messages:=" under WebSphere MQ in the above link. A whole book about error codes, what they mean, and what to do about it. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|