JmsGetConsumerMessageListener Function

Action

Gets the listener of the given destination.

Include file

Jms.bdh

Syntax

JmsGetConsumerMessageListener( in sJndiDestinationName : string ): number;
Parameter Description
sJndiDestinationName The destination for which we want to attach the listener

Return value

Returns the handle of the given destination's listener.

Example

  transaction TExampleGetMessageAsynchronously
  var hHandle : number;
  begin
    JavaCallMethod(ghJmsSampleObj, "getMessageListener");        
    hHandle := JavaGetObject(ghJmsSampleObj);

    JmsSetConsumerMessageListener(csQueue, hHandle);
    JmsClearMessage();
    JmsSendTextMessage("Text message 1 for the message listener!", csQueue); 
    JmsSendTextMessage("Text message 2 for the message listener!", csQueue); 
    JmsSendTextMessage("Text message 3 for the message listener!", csQueue); 
    if (JmsGetConsumerMessageListener(csQueue) = 0) then
      RepMessage("No message listener set for " + csQueue, SEVERITY_WARNING);
    else
      // We have to wait for the 3 messages to get to the listener
      Wait 5.0;  
    end;
  end TExampleGetMessageAsynchronously; 

Sample scripts

JmsSample.bdf, JmsSample.java