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 » Newbie help with a get

Post new topic  Reply to topic
 Newbie help with a get « View previous topic :: View next topic » 
Author Message
JamesD
PostPosted: Fri May 19, 2006 1:35 pm    Post subject: Newbie help with a get Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Fri May 19, 2006 4:06 pm    Post subject: Reply with quote

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
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 » Newbie help with a get
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.