Kbase P16770: Progress SonicMQ 4GL adapter memory leak in example6.p
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.x
SonicMQ 4.x
SYMPTOM(s):
Progress SonicMQ 4GL adapter memory leak in example6.p
Maximum number of messages is 50. Increase the global int variable MAX-JMS-MESSAGES or call deleteMessage IN <message-handler >
CAUSE:
The messageHandler of example6.p deletes the received message object but not the
new created and published message object for the reply as the below code snip shows:
PROCEDURE messageHandler:
DEFINE INPUT PARAMETER messageH AS HANDLE NO-UNDO.
DEFINE INPUT PARAMETER messageConsumerH AS HANDLE NO-UNDO.
DEFINE OUTPUT PARAMETER autoReplyH AS HANDLE NO-UNDO. /* Not used in this example */
DEFINE VARIABLE replyH AS HANDLE.
DISPLAY DYNAMIC-FUNCTION('getText':U IN messageH) format "x(60)".
IF NOT DYNAMIC-FUNCTION('hasReplyTo':U IN messageH) THEN RETURN.
/* Publishes a reply explicitly - using the publish call. */
RUN createTextMessage IN pubsubsession (OUTPUT replyH).
RUN setText IN replyH("Will bid. Send data in sportsXML format.").
RUN publish IN pubsubsession (DYNAMIC-FUNCTION('getJMSReplyTo':U IN messageH),
replyH, ?, ?, ?).
RUN deleteMessage IN messageH.
END.
FIX:
Add line:
deleteMessage IN replyH.
after the reply message is published.
Corrected code snip below:
PROCEDURE messageHandler:
DEFINE INPUT PARAMETER messageH AS HANDLE NO-UNDO.
DEFINE INPUT PARAMETER messageConsumerH AS HANDLE NO-UNDO.
DEFINE OUTPUT PARAMETER autoReplyH AS HANDLE NO-UNDO. /* Not used in this example */
DEFINE VARIABLE replyH AS HANDLE.
/* DUG - Display the message number as debug */ DISPLAY vCount. vCount = vCount + 1.
DISPLAY DYNAMIC-FUNCTION('getText':U IN messageH) format "x(60)".
IF NOT DYNAMIC-FUNCTION('hasReplyTo':U IN messageH) THEN RETURN.
/* Publishes a reply explicitly - using the publish call. */
RUN createTextMessage IN pubsubsession (OUTPUT replyH).
RUN setText IN replyH("Will bid. Send data in sportsXML format.").
RUN publish IN pubsubsession (DYNAMIC-FUNCTION('getJMSReplyTo':U IN messageH),
replyH, ?, ?, ?).
RUN deleteMessage IN messageH.
/* After we have sent the message, delete it **** THIS IS THE FIX ****/
RUN deleteMessage IN replyH.
END.