JmsClearMessage Function

Action

Clears the header, body, and properties of the current message.

Include file

Jms.bdh

Syntax

JmsClearMessage( in sMessageSelector : string );
Parameter Description
sMessageSelector Only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.

Example

transaction TExampleSendReceiveObjectMessage
  var hObject : number;
      hObjectReturned : number;
      sReturnType : number;
  begin
    JavaCallMethod(ghJmsSampleObj, "generateObject");    
    hObject := JavaGetObject(ghJmsSampleObj);

    JmsClearMessage();

    JmsSendObjectMessage(hObject, csQueue);
    sReturnType := JmsReceiveMessage(csQueue, -1);
    
    if (sReturnType = JMS_MSG_TYPE_OBJECT) then
      hObjectReturned := JmsGetMessageObject();
      JavaCastObject(hObjectReturned, "java/lang/Object");
      JavaSetObject(ghJmsSampleObj, hObjectReturned);
      JavaCallMethod(ghJmsSampleObj, "handleObject");    
    else
      RepMessage("ObjectMessage expected!", SEVERITY_ERROR);
    end;
  end TExampleSendReceiveObjectMessage; 

Sample scripts

JmsSample.bdf, JmsSample.java