Large message body MSMQ windows

Posted by fredyckson on 31-Jul-2017 10:29

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

Posted by Brian K. Maher on 01-Aug-2017 10:22

Have you increased the -s startup parameter as the error message says?  If so, to what value?

Posted by fredyckson on 01-Aug-2017 14:01

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

Posted by Brian K. Maher on 01-Aug-2017 14:14

What do you mean by that?
 
Can you paste in a screen capture or something?
 
-s 3500 isn’t that large and shouldn’t cause the machine to go down.

Posted by fredyckson on 02-Aug-2017 10:30

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]

Posted by Brian K. Maher on 02-Aug-2017 11:10

Couple of things...
 
First, message out session:startup-parameters and send a screen capture of the dialog box.  This is to verify that the -s 3500 is taking effect.
 
Second, try changing to PUT-BYTES to PUT-STRING(hMsg:Body,1,GET-SIZE(vmemptr)) = vmemptr.
 
Third, a question ... why arent you using the .NET MSMQ classes?

Posted by fredyckson on 02-Aug-2017 13:33

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:

https://knowledgebase.progress.com/articles/Article/How-to-use-Microsoft-MSMQ-from-within-ABL?q=msmq&l=en_US&fs=Search&pn=1

[View:/cfs-file/__key/communityserver-discussions-components-files/19/test2queue.docx:320:240]

Posted by Brian K. Maher on 02-Aug-2017 13:40

Use this so we get the complete startup-parameters list...
 
MESSAGE SESSION:STARTUP-PARAMETERS VIEW-AS ALERT-BOX.

Posted by fredyckson on 02-Aug-2017 15:01

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.

Posted by fredyckson on 02-Aug-2017 15:36

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..

Posted by fredyckson on 02-Aug-2017 16:04

Brian, i did another test without string conversion and the message error appears insufficient resources. I did the test with -s 10000.

Posted by fredyckson on 03-Aug-2017 09:26

Hi Brian, I think the problem is on the progress side in the configuration of the msg:Body attribute, I did the test with the queueexplorer tool and it works with the 3 mb file:

I applied the steps of the last link you sent me but it didn't work.

Posted by Brian K. Maher on 03-Aug-2017 10:08

Please open a support case for this.  It needs more time than I can give it here.

This thread is closed