Why are there multiple listeners to receive the messages for only one "Wait for JMS Queue Message"?

Why are there multiple listeners to receive the messages for only one "Wait for JMS Queue Message"?

book

Article ID: KB0090638

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Description:
==========
If you use one "Wait for JMS Queue Message" activity to receive multiple messages in the queue, you will see multiple listeners on the EMS server side.

The following information is from the BW documention:

===================================================================
Difference between Get JMS Queue Message activity and Wait for JMS Queue message activity.

Description:

The "Get JMS Queue Message" activity uses the pull mechanism to receive messages from the JMS server.  So if there is a message in the queue, it will be received immediately.  If there is no message, this activity will wait for a message to arrive at the queue or timeout, whichever occurs first.  It is not a good idea to set timeout to 0 or blank, else this activity will wait indefinitely until a message arrives at the queue.  The "Wait for JMS Queue Message" activity works in passive mode.  It is notified once a message arrives on the specified queue.

Another difference is on the number of message these activities can process.  Suppose the Message Selector is not used, when BW engine starts up the "Get JMS Queue Message" activity in this engine receives only one message from queue, but the "Wait for JMS Queue Message" activity consumes all messages from the queue, even though the message selector does not apply to any of the messages pending on the queue.

Example usage of the "Wait for JMS Queue Message" activity could be that when you send out a request to a request queue and then expect a response from a response queue.  In this case, you can use Candidate Event Key and Key fields to get the correct response message from response queue.
===================================================================

From the above information, "Wait for JMS Queue Message" will receive all messages that meet the criteria. It opens multiple listeners to speed up the receiving.

Environment:
==========
TIBCO ActiveMatrix BusinessWorks™ / All

Symptoms:
==========
If you use one "Wait for JMS Queue Message" activity to receive multiple messages in the queue, you will see multiple listeners on the EMS server side by "show queues and show consumers queue = XXX" on the EMS server console.

Cause:
==========
"Wait for JMS Queue Message" activity consumes all messages from the queue.

Resolution:
==========
You can set Acknowledge Mode to "TIBCO EMS Explicit" to use only one listener to receive messages.


Issue/Introduction

Why are there multiple listeners to receive the messages for only one "Wait for JMS Queue Message"?