Apama 10.3.1 | Apama Documentation | Connecting Apama Applications to External Components | Correlator-Integrated Support for the Java Message Service (JMS) | Using the Java Message Service (JMS) | Monitoring correlator-integrated messaging for JMS status
 
Monitoring correlator-integrated messaging for JMS status
Apama applications often need to monitor the status of JMS connections, senders, and receivers when the application needs to wait for a receiver or sender to be available (status "OK") before using it, and, conversely, to detect and report error conditions.
The main way to monitor status is to simply set up EPL listeners for the JMSConnection, JMSReceiverStatus, and JMSSenderStatus events which are sent to all public correlator contexts automatically, both on startup and whenever the status of these items changes. Note that there is no need to 'subscribe' to receive these events — provided JMS.onApplicationInitialized() was called, these events will be sent automatically, so all that is required is to set up listeners.
Some applications, especially those built using scenarios rather than EPL, prefer to monitor status using the standardized event API defined by StatusSupport.mon. The CorrelatorJMSStatusManager monitor, which is part of the correlator-integrated messaging for JMS bundle, acts as a bridge between the JMS-specific status events and this API, to allow Apama applications to monitor the status of JMS connections, senders and receivers using the standard Status Support interface.
* To use this interface
1. Send a com.apama.statusreport.SubscribeStatus event, which is defined as:
event SubscribeStatus {
string serviceID;
string object;
string subServiceID;
string connection;
}
The fields for the SubscribeStatus event are:
*serviceID - This should be set to CORRELATOR_JMS.
*object - Can be CONNECTION, RECEIVER, or SENDER, or "" (empty string). If "" is specified, the application will subscribe to status events for all connections, receivers, and senders.
*subServiceID - The name of a specific receiver or sender if RECEIVER or SENDER is specified in the object field. If the object field specifies RECEIVER or SENDER, the subServiceID field must have a valid, non-empty value. If the object field specifies CONNECTION this field must be "".
*connection - The name of a specific connection. If the object field specifies a value, the connection field must have a valid, non-empty value.
2. Create listeners for com.apama.statusreport.Status events (and optionally for StatusError events which are sent if the status subscription failed due to an invalid identifier being specified).
3. To unsubscribe, send an UnsubscribeStatus event with field values that match the corresponding SubscribeStatus event.
For more information on monitoring correlator-integrated messaging for JMS connections, receivers, and senders, see the descriptions of the JMSConnectionStatus, JMSReceiverStatus, and JMSSenderStatus events in the ApamaDoc documentation.

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.