Large message body MSMQ windows - Forum - OpenEdge Development - Progress Community
 Forum

Large message body MSMQ windows

This question is not answered

Hi everyone, I'm working with the exchange of messages between MSMQ  windows server and anothers servers, I currently have a problem with the message > 32kb, the source code for the sendmsg procedure:

&GLOBAL-DEFINE MQ_RECEIVE_ACCESS 1
&GLOBAL-DEFINE MQ_SEND_ACCESS 2

PROCEDURE prepareQueue.ip:
DEFINE INPUT PARAMETER cPathName AS CHARACTER NO-UNDO.
CREATE "MSMQ.MSMQQueueInfo" hQueueInfo.

ASSIGN
hQueueInfo:PATHNAME = cPathName.
END PROCEDURE.

PROCEDURE sendMsg.ip:
DEFINE INPUT PARAMETER cMessage AS LONGCHAR NO-UNDO.
DEFINE INPUT PARAMETER cLabel AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER cID AS CHARACTER NO-UNDO.

DEFINE VARIABLE hQueueDest AS COMPONENT-HANDLE NO-UNDO.
DEFINE VARIABLE hMsg AS COMPONENT-HANDLE NO-UNDO.
DEFINE VARIABLE vBody AS RAW NO-UNDO.
DEFINE VARIABLE vMaxLen AS INT64 NO-UNDO.
DEFINE VARIABLE vBody2 AS CHARACTER NO-UNDO.
DEFINE VARIABLE logic AS LOGICAL NO-UNDO.
DEFINE VARIABLE vMsg1 AS LONGCHAR NO-UNDO.
DEFINE VARIABLE oBody AS OpenEdge.Core.Memptr NO-UNDO.
DEFINE VARIABLE l-memptr AS MEMPTR NO-UNDO.

CREATE "MSMQ.MSMQMessage" hMsg.

hQueueDest = hQueueInfo:OPEN( {&MQ_SEND_ACCESS}, 0 ).

hMsg:LABEL = cLabel.
//put-string(hMsg:Body, 1) = cMessage.  // cMessage < 32k
COPY-LOB cMessage TO l-memptr.

//oBody = NEW OpenEdge.Core.Memptr(l-memptr).
// hMsg:Body:put-bytes(oBody,get-size(oBody)).
PUT-BYTES(hMsg:Body, 1) = l-memptr.
hMsg:Send( hQueueDest ).

DO TRANSACTION:
FIND bb_MessageQueue WHERE bb_MessageQueue.bb_MessageQueue_ID EQ cID EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
IF AVAILABLE bb_MessageQueue THEN
DO:
ASSIGN
bb_MessageQueue.Processed = YES
bb_MessageQueue.TransacTime = NOW.
RELEASE bb_MessageQueue.
END.
END.

hQueueDest:CLOSE().
RELEASE OBJECT hMsg NO-ERROR.
RELEASE OBJECT hQueueDest NO-ERROR.
ASSIGN
hMsg = ?
hQueueDest = ?.
END PROCEDURE.

the procedure receive an message of type longchar, I use PUT-BYTES in place of PUT-STRING (because this doesn't work with msgbody > 32k), I convert the message to MEMPTR, but It doesn't work 

My version OpenEdge Release is 11.6.3

I would appreciate any kind of help to correct this error or to know another strategic to follow.

All Replies