|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MqGet gives the RC2079 error, puts the message on the DLQ |
« View previous topic :: View next topic » |
Author |
Message
|
adityavarma |
Posted: Fri Apr 09, 2004 8:03 am Post subject: MqGet gives the RC2079 error, puts the message on the DLQ |
|
|
Newbie
Joined: 09 Apr 2004 Posts: 2
|
I have defined the buffer size as 32767 (Char) before I do the get on the Q. The maximum length of the message being put on the Q is 3000 (Char). The Get still returns the RC2079 error saying that the message is longer than the buffer. Also, the message is being put on the DLQ even if I specify the 'AllowTruncateMessage' option. I have evn tried browsing the message first to get the Message Length and then turn around and do a get using a buffer defined with this length. That also did not work.
Any suggestions/help is deeply appreciated. |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Apr 09, 2004 9:25 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
What programming language? Can you post a code snippet? Did you try using the amqsbcg sample program to see how big it thought the message was? |
|
Back to top |
|
 |
adityavarma |
Posted: Fri Apr 09, 2004 10:24 am Post subject: MqGet gives the RC2079 error, puts the message on the DLQ |
|
|
Newbie
Joined: 09 Apr 2004 Posts: 2
|
Hi,
Thanks for the reply. I am attaching the code routine that does this. I don't have the AMQsbcg routine in my samples here. We are on WMQ 5.2 here.
// Message data
D MsgData S 32767A
// Handle connection
D HConn S 10I 0
// Object handle
D HGetQ S 10I 0
// Options
D Opts S 10I 0
// Completion codes
D ECode S 10I 0
D CCode S 10I 0
// Reason codes
D Reason S 10I 0
// Buffer length
D BufLen S 10I 0
// Message length
D MsgLen S 10I 0
// Buffer pointer
D BufPtr S *
// Codes...
D CName S 6A Inz
D RCode S 10I 0 Inz
D PanNan S 5I 0 Inz(0)
D FileNm S 10A Inz
// User header - header part of the MsgData.
DUserHdr Ds
D MsgType 30A
D HdrVer 6A
D Filler 30A
/Free
MqTmc2 = Tmc2;
// Connect to the queue manager
MQConn(Tc2QMn : HConn : ECode : Reason);
// report reason and stop if it failed
If ECode = CCFail;
CName = 'MQCONN'; // Error - MQCONN ended
RCode = Reason;
CCode = ECode; // Error - "unable to connect to MQM"
Return;
EndIf;
// Open the target message queue for output (and fail if
// MQM is quiescing)
// Resulting queue handle is HGetQ
Opts = OoInpQ + OoFiq; // Set the open options
OdOn = Tc2QN; // Qname to connect to
MqOpen(HConn : MqOd : Opts : HGetQ : ECode : Reason);
If ECode = CCFail;
CName = 'MQOpen'; // Error - MQOpen ended
RCode = Reason;
CCode = ECode; // Error - "unable to open specified Q"
Return;
EndIf;
// Get the message if the open succeeded. . .
CCode = ECode;
DoW CCode <> CCFail;
BufLen = %Size(MsgData); // Size of the message buffer
BufPtr = %Addr(MsgData); // Set buffer pointer to MsgData..
Clear MsgData; // Clear the input buffer
PanNan = 0;
// options - Output and FailIfQuiescing
// Opts = OOInpQ + OOFiq;
// Set the Get options...
GmOpt = GmWt + GmConv + GmFiq;
// Get options
// Wait before proceeding...
// Convert if required.. (ASCII to EBCIDIC)
// Fail if queiscing
GmWi = 15000; // Set wait interval to 15 seconds
MdMid = MiNone; // No condition on Message Id
MdCid = CiNone; // No condition on Co-relation Id
MQGet(HConn : HGetQ : MQMd : MQGmo :
BufLen : BufPtr : MsgLen : CCode : Reason);
Select;
When Reason = RcNone;
UserHdr = MsgData; // Write the MsgData to UserHdr
FileNm = WrtMsgToFile(MsgData); // Write to file
If FileNm <> *Blanks; //Write failed if FileName returned
PanNan = 1;
MsgType = %Trim(MsgType) + '.' + %Trim(FileNm);
EndIf;
MsgData = UserHdr; // Write the UserHdr only to the report Q
// Write a message to the report Queue
PutRptMsg(MdRq : HConn : MdMid : PanNan : MsgData);
When Reason = Rc2033; // message not found or Q is empty
Leave;
When Reason <> RCNone; // report reason, if any;
CName = 'MQGet'; // "MQGet ended with reason code ...."
RCode = Reason; // Execute Exception here
EndSl;
EndDo;
// Close the Q if it is Open and empty
If ECode <> CCFail;
Opts = CoNone;
MqClose(HConn : HGetQ : Opts : CCode : Reason);
If Reason <> RcNone;
CName = 'MQClose'; // Error - MQOpen error
RCode = Reason;
Return;
EndIf;
EndIf;
// Disconnect from the Q manager
MQDisc(HConn : ECode : Reason);
// report reason and stop if it failed
If CCode = CCFail; // MQDISC ended with reason code
CName = 'MQDISC';
RCode = Reason; // Execute Exception here
EndIf;
Return;
Note: This is written in RPGLE.
Thanks,
Aditya.[/code] |
|
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
|
|
|
|