<!-- Services for ActiveMQ Brokers, Connector, Topic, Queues.
  -  This XML fragment is suitable for including in plugin XML files for 
  -  applications that embed ActiveMQ.
  -  This file uses metric definitions from fuse-destination-metrics.xml
  -  and **will not function correctly** unless fuse-destination-metrics.xml
  -  has been included earlier in the including file.
  -  
  -  You will also need to ensure that you add a filter definition for the
  -  ${messaging_domain} expansion, thusly:
  -
  -         <filter name="messaging_domain" value="org.apache.activemq"/>
  -->

<service name="Connector">
  <property name="OBJECT_NAME" value="${messaging_domain}:Type=Connector,BrokerName=*,ConnectorName=*"/>
  <config>
    <option name="BrokerName" description="Broker Name" default=""/>
    <option name="ConnectorName" description="Connector Name" default=""/>
  </config>
	<plugin type="autoinventory"/>
	<plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/>
	<actions include="start,stop"/>
	<metric name="Availability" indicator="true"/>
</service>

<service name="Broker">
	<property name="OBJECT_NAME" value="${messaging_domain}:Type=Broker,BrokerName=*"/>
	<config>
		<option name="BrokerName" description="Broker Name" default=""/>
	</config>
	<plugin type="autoinventory"/>
	<plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/>
	<actions include="start,stop,gc,removeTopic,removeQueue"/>
	<metric name="Availability" indicator="true"/>
	<metric name="Total Consumer Count" indicator="true"/>
	<metric name="Total Enqueue Count" indicator="true" collectionType="trendsup"/>
	<metric name="Total Dequeue Count"  indicator="true" collectionType="trendsup"/>
	<metric name="Total Message Count" indicator="true" collectionType="trendsup"/>
	<metric name="Memory Percent Usage" indicator="true" units="percentage"/>
	<metric name="Memory Limit" indicator="true" />
</service>

<service name="Queue">
	<property name="OBJECT_NAME" value="${messaging_domain}:Type=Queue,BrokerName=*,Destination=*"/> 
	<config include="destination"/>
	<metrics include="destination"/>
	<plugin type="autoinventory"/>
	<plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/> 
	<actions include="sendTextMessage"/>
</service>

<!-- same as Queue except for Type=Topic -->
<service name="Topic">
	<property name="OBJECT_NAME" value="${messaging_domain}:Type=Topic,BrokerName=*,Destination=*"/>
	<config include="destination"/>
	<metrics include="destination"/>
	<plugin type="autoinventory"/>
	<plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/>
	<actions include="sendTextMessage"/>
</service>
