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.
Tks for your answer Brian, yes I incresed the -s startup until 3500 and my machine stopped because of resource consumption. But I think there should be a way to manage this kind of large message exchange at moment when taking the value of a msg type MEMPTR or LONGCHAR and give it to hmsg:body
Hi Brian, I attach the file of the tests. tks
[View:/cfs-file/__key/communityserver-discussions-components-files/19/testqueuecase_5F00_progress.docx:320:240]
ok, I attach the document whit the test, with respect to the last question I followed this way by managing the queue
https://knowledgebase.progress.com/articles/Article/P89005?q=msmq&l=en_US&fs=Search&pn=1
you tell me to change for this way:
[View:/cfs-file/__key/communityserver-discussions-components-files/19/test2queue.docx:320:240]
Hi, I attach the document with the test..
[View:/cfs-file/__key/communityserver-discussions-components-files/19/test3queue.docx:320:240]
the same error, my machine stops.
Brian, I just did the test using the .NET MSMQ classes and the same error with:
(lcMessage longchar 3MB file)
msg:Body = STRING(lcMessage).
I can't use VARIABLE vmemptr AS MEMPTR to assign msg:Body
I used the same -s 3500 startup parameter, the problem is msg:Body just acept longchar until 32k, if I could change the data type of msg:Body I thing that I could find the solution..