JmsGetMessageObject Function

Action

Gets the object from the last received message.

Include file

Jms.bdh

Syntax

JmsGetMessageObject(): string;

Return value

Returns the handle of the object sent with the message.

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