README
1================================================================================
2@(#)README 1.6 09/14/04
3================================================================================
4
5Broker Monitoring API examples
6
7Description
8-----------
9This directory contain examples that demonstrate the Oracle GlassFish(tm)
10Server Message Queue broker monitoring API. The examples consist of separate
11applications each showing how to subscribe to and receive different monitoring
12information from the broker.
13
14Files
15-----
16BrokerMetrics.java Source file for monitoring application that
17 displays broker metrics.
18DestListMetrics.java Source file for monitoring application that
19 displays destination list metrics.
20DestMetrics.java Source file for monitoring application that
21 displays a specific destination's metrics.
22MetricsPrinter.java Utility class used for printing in neat columns.
23MultiColumnPrinter.java Utility class used for printing in neat columns.
24VMMetrics.java Source file for monitoring application that
25 displays broker VM metrics.
26*.class Prebuilt Java class files for these examples.
27README This file.
28
29There are four different types of monitoring information
30that a JMS application can subscribe to on the broker.
31
32The example applications consist of four JMS applications,
33each demonstrating, for each of the different monitoring types:
34- how to subscribe to the relevant monitoring topic
35- how to process the received monitoring messages
36
37Here are the different monitoring types and a summary of information
38that is available:
39
40Broker metrics
41 Cumulative number of messages/packets flowing in/out of broker
42 Cumulative sizes of messages/packets flowing in/out of broker
43 Connection/destination counts
44
45Destination List
46 List of destinations on the broker
47
48Destination metrics (information here is for a specific destination)
49 Current/average/peak counts of active/backup consumers
50 Cumulative number of messages flowing in/out of destination
51 Cumulative size of messages flowing in/out of destination
52 Current/average/peak counts of messages,
53 Current/average/peak total size of messages
54 Disk usage
55
56Java VM metrics
57 JVM memory heap size: max, total, free
58
59Configuring the environment
60---------------------------
61To recompile or run this example, you need to set CLASSPATH
62to include at least:
63 jms.jar
64 imq.jar
65 directory containing this example
66
67A detailed guideline on configuring your enrivonment and setting CLASSPATH
68is found in the top-level README file of the examples (demo) directory of
69the Message Queue installation (<IMQ_HOME>/examples/README) as well as in
70the "Quick Start Tutorial" in the Oracle GlassFish(tm) Server Message Queue
71Developer's Guide.
72
73Building the example
74--------------------
75Compile the sample programs individually if you wish, or all at
76once by using the command
77
78 javac *.java
79
80Running the example
81-------------------
82The examples can be run using the java command e.g.
83
84 java <classname> <options>
85
86For example,
87
88 java BrokerMetrics
89
90By default all monitoring examples will connect to the broker running on localhost:7676.
91You can use -DimqAddressList attribute to change the host, port and
92transport:
93
94 java -DimqAddressList=mq://<host>:<port>/jms DestMetrics -t q -n SimpleQueue
95
96Here is a description of each of the examples:
97
98BrokerMetrics
99-------------
100This application displays broker metrics. It also
101shows how to calculate rate information, similar
102to what is displayed by the command:
103
104 imqcmd metrics bkr -m rts
105
106This application takes the following options (similar to
107imqcmd):
108
109 -m ttl Show totals e.g. total/accumulative number of msgs
110 that flowed in/out of the broker. This is the
111 default.
112 -m rts Show rates e.g. rate of message flow in/out of
113 broker.
114
115Example usage:
116 java BrokerMetrics
117 java BrokerMetrics -m ttl
118 java BrokerMetrics -m rts
119
120DestListMetrics
121---------------
122This application displays the current list of destinations
123on the broker.
124
125Example usage:
126 java DestListMetrics
127
128DestMetrics
129-----------
130This application displays the metric information for a specific
131destination. It simulates the following command:
132
133$IMQ_HOME/bin/imqcmd metrics dst -t <dest type> -n <dest name>
134
135The destination can be specified using the same options as imqcmd:
136 -t Destination type (t or q)
137 -n Destination name
138
139Example usage:
140 java DestMetrics -t q -n SimpleQueue
141 java DestMetrics -t t -n SimpleTopic
142
143VMMetrics
144---------
145Displays the free, maximum, and total memory used by the broker JVM.
146
147Example usage:
148 java VMMetrics
149