JmsSendObjectMessage Function

Action

Sends an object message to the given destination.

Include file

Jms.bdh

Syntax

JmsSendObjectMessage( in objMessage           : number,
                      in sJndiDestinationName : string, 
                      in sMeasureName         : string optional );
Parameter Description
objMessage The handler of the object to send
sJndiDestinationName The destination to send this message to
sMeasureName (optional) The name of this measure. Default is the method name.

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