Configuring JMX Notifications Configuring JMS Notifications

10-2 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server

10.2 Configuring JMX Notifications

For each defined JMX notification, WLDF issues JMX events notifications whenever an associated watch is triggered. Applications can register a notification listener with the servers WLDFWatchJMXNotificationRuntimeMBeans to receive all notifications and filter the provided output. You can also specify a JMX notification type string that a JMX client can use as a filter. Example 10–1 shows an example of a JMX notification configuration. Example 10–1 Example Configuration for a JMX Notification wldf-resource xmlns=http:xmlns.oracle.comweblogicweblogic-diagnostics xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:xmlns.oracle.comweblogicweblogic-diagnostics1.0webl ogic-diagnostics.xsd namemywldf1name watch-notification -- One or more watch configurations -- jmx-notification namemyJMXNotifname enabledtrueenabled jmx-notification -- Other notification configurations -- watch-notification wldf-resource Here is an example of a JMX notification: Notification name: myjmx called. Count= 42. Watch severity: Notice Watch time: Jul 19, 2005 3:40:38 PM EDT Watch ServerName: myserver Watch RuleType: Harvester Watch Rule: {com.bea:Name=myserver,Type=ServerRuntimeOpenSocketsCurrentCount} 1 Watch Name: mywatch Watch DomainName: mydomain Watch AlarmType: None Watch AlarmResetPeriod: 10000

10.3 Configuring JMS Notifications

JMS notifications are used to post messages to JMS topics andor queues in response to the triggering of an associated watch. In the system resource configuration file, the elements destination-jndi-name and connection-factory-jndi-name define how the message is to be delivered. Example 10–2 shows two JMS notifications that cause JMS messages to be sent through the provided topics and queues using the specified connection factory. For this to work properly, JMS must be properly configured in the config.xml configuration file for the domain, and the JMS resource must be targeted to this server. Note: To define notifications programmatically, use weblogic.diagnostics.watch.WatchNotification. Configuring Notifications 10-3 Example 10–2 Example JMS Notifications wldf-resource xmlns=http:xmlns.oracle.comweblogicweblogic-diagnostics xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:xmlns.oracle.comweblogicweblogic-diagnostics1.0webl ogic-diagnostics.xsd namemywldf1name watch-notification -- One or more watch configurations -- jms-notification namemyJMSTopicNotifname destination-jndi-nameMyJMSTopicdestination-jndi-name connection-factory-jndi-nameweblogic.jms.ConnectionFactory connection-factory-jndi-name jms-notification jms-notification namemyJMSQueueNotifname destination-jndi-nameMyJMSQueuedestination-jndi-name connection-factory-jndi-nameweblogic.jms.ConnectionFactory connection-factory-jndi-name jms-notification -- Other notification configurations -- watch-notification wldf-resource The content of the notification message gives details of the watch and notification.

10.4 Configuring SNMP Notifications