activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject svn commit: r1018163 [26/45] - in /websites/production/activemq/content/artemis/docs: 2.2.0/ latest/ latest/diagrams/ latest/gitbook/ latest/gitbook/fonts/ latest/gitbook/fonts/fontawesome/ latest/gitbook/gitbook-plugin-fontsettings/ latest/gitbook/git...
Date Thu, 14 Sep 2017 19:48:13 GMT
Added: websites/production/activemq/content/artemis/docs/latest/management.html
==============================================================================
--- websites/production/activemq/content/artemis/docs/latest/management.html (added)
+++ websites/production/activemq/content/artemis/docs/latest/management.html Thu Sep 14 19:48:11 2017
@@ -0,0 +1,1633 @@
+
+<!DOCTYPE HTML>
+<html lang="" >
+    <head>
+        <title>Management · ActiveMQ Artemis Documentation</title>
+        <meta charset="UTF-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+        <meta name="description" content="">
+        <meta name="generator" content="GitBook 3.1.1">
+        
+        
+        
+    
+    <link rel="stylesheet" href="gitbook/style.css">
+
+    
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
+                
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
+                
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
+                
+            
+        
+
+    
+
+    
+        
+    
+        
+    
+        
+    
+        
+    
+        
+    
+        
+    
+
+        
+    
+    
+    <meta name="HandheldFriendly" content="true"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
+    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
+
+    
+    <link rel="next" href="management-console.html" />
+    
+    
+    <link rel="prev" href="pre-acknowledge.html" />
+    
+
+    </head>
+    <body>
+        
+<div class="book">
+    <div class="book-summary">
+        
+            
+<div id="book-search-input" role="search">
+    <input type="text" placeholder="Type to search" />
+</div>
+
+            
+                <nav role="navigation">
+                
+
+
+<ul class="summary">
+    
+    
+
+    
+
+    
+        
+        
+    
+        <li class="chapter " data-level="1.1" data-path="./">
+            
+                <a href="./">
+            
+                    
+                    Introduction
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.2" data-path="notice.html">
+            
+                <a href="notice.html">
+            
+                    
+                    Legal Notice
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.3" data-path="preface.html">
+            
+                <a href="preface.html">
+            
+                    
+                    Preface
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.4" data-path="project-info.html">
+            
+                <a href="project-info.html">
+            
+                    
+                    Project Info
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.5" data-path="messaging-concepts.html">
+            
+                <a href="messaging-concepts.html">
+            
+                    
+                    Messaging Concepts
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.6" data-path="architecture.html">
+            
+                <a href="architecture.html">
+            
+                    
+                    Architecture
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.7" data-path="using-server.html">
+            
+                <a href="using-server.html">
+            
+                    
+                    Using the Server
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.8" data-path="address-model.html">
+            
+                <a href="address-model.html">
+            
+                    
+                    Address Model
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.9" data-path="using-jms.html">
+            
+                <a href="using-jms.html">
+            
+                    
+                    Using JMS
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.10" data-path="using-core.html">
+            
+                <a href="using-core.html">
+            
+                    
+                    Using Core
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.11" data-path="using-AMQP.html">
+            
+                <a href="using-AMQP.html">
+            
+                    
+                    Using AMQP
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.12" data-path="jms-core-mapping.html">
+            
+                <a href="jms-core-mapping.html">
+            
+                    
+                    Mapping JMS Concepts to the Core API
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.13" data-path="client-classpath.html">
+            
+                <a href="client-classpath.html">
+            
+                    
+                    The Client Classpath
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.14" data-path="examples.html">
+            
+                <a href="examples.html">
+            
+                    
+                    Examples
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.15" data-path="wildcard-routing.html">
+            
+                <a href="wildcard-routing.html">
+            
+                    
+                    Routing Messages With Wild Cards
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.16" data-path="wildcard-syntax.html">
+            
+                <a href="wildcard-syntax.html">
+            
+                    
+                    Understanding the Apache ActiveMQ Artemis Wildcard Syntax
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.17" data-path="filter-expressions.html">
+            
+                <a href="filter-expressions.html">
+            
+                    
+                    Filter Expressions
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.18" data-path="persistence.html">
+            
+                <a href="persistence.html">
+            
+                    
+                    Persistence
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.19" data-path="configuring-transports.html">
+            
+                <a href="configuring-transports.html">
+            
+                    
+                    Configuring Transports
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.20" data-path="config-reload.html">
+            
+                <a href="config-reload.html">
+            
+                    
+                    Configuration Reload
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.21" data-path="connection-ttl.html">
+            
+                <a href="connection-ttl.html">
+            
+                    
+                    Detecting Dead Connections
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.22" data-path="slow-consumers.html">
+            
+                <a href="slow-consumers.html">
+            
+                    
+                    Detecting Slow Consumers
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.23" data-path="network-isolation.html">
+            
+                <a href="network-isolation.html">
+            
+                    
+                    Avoiding Network Isolation
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.24" data-path="critical-analysis.html">
+            
+                <a href="critical-analysis.html">
+            
+                    
+                    Detecting Broker Issues (Critical Analysis)
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.25" data-path="transaction-config.html">
+            
+                <a href="transaction-config.html">
+            
+                    
+                    Resource Manager Configuration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.26" data-path="flow-control.html">
+            
+                <a href="flow-control.html">
+            
+                    
+                    Flow Control
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.27" data-path="send-guarantees.html">
+            
+                <a href="send-guarantees.html">
+            
+                    
+                    Guarantees of sends and commits
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.28" data-path="undelivered-messages.html">
+            
+                <a href="undelivered-messages.html">
+            
+                    
+                    Message Redelivery and Undelivered Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.29" data-path="message-expiry.html">
+            
+                <a href="message-expiry.html">
+            
+                    
+                    Message Expiry
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.30" data-path="large-messages.html">
+            
+                <a href="large-messages.html">
+            
+                    
+                    Large Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.31" data-path="paging.html">
+            
+                <a href="paging.html">
+            
+                    
+                    Paging
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.32" data-path="queue-attributes.html">
+            
+                <a href="queue-attributes.html">
+            
+                    
+                    Queue Attributes
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.33" data-path="scheduled-messages.html">
+            
+                <a href="scheduled-messages.html">
+            
+                    
+                    Scheduled Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.34" data-path="last-value-queues.html">
+            
+                <a href="last-value-queues.html">
+            
+                    
+                    Last-Value Queues
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.35" data-path="message-grouping.html">
+            
+                <a href="message-grouping.html">
+            
+                    
+                    Message Grouping
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.36" data-path="pre-acknowledge.html">
+            
+                <a href="pre-acknowledge.html">
+            
+                    
+                    Extra Acknowledge Modes
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter active" data-level="1.37" data-path="management.html">
+            
+                <a href="management.html">
+            
+                    
+                    Management
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.38" data-path="management-console.html">
+            
+                <a href="management-console.html">
+            
+                    
+                    Management Console
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.39" data-path="security.html">
+            
+                <a href="security.html">
+            
+                    
+                    Security
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.40" data-path="broker-plugins.html">
+            
+                <a href="broker-plugins.html">
+            
+                    
+                    Broker Plugins
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.41" data-path="resource-limits.html">
+            
+                <a href="resource-limits.html">
+            
+                    
+                    Resource Limits
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.42" data-path="jms-bridge.html">
+            
+                <a href="jms-bridge.html">
+            
+                    
+                    The JMS Bridge
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.43" data-path="client-reconnection.html">
+            
+                <a href="client-reconnection.html">
+            
+                    
+                    Client Reconnection and Session Reattachment
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.44" data-path="diverts.html">
+            
+                <a href="diverts.html">
+            
+                    
+                    Diverting and Splitting Message Flows
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.45" data-path="core-bridges.html">
+            
+                <a href="core-bridges.html">
+            
+                    
+                    Core Bridges
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.46" data-path="duplicate-detection.html">
+            
+                <a href="duplicate-detection.html">
+            
+                    
+                    Duplicate Message Detection
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.47" data-path="clusters.html">
+            
+                <a href="clusters.html">
+            
+                    
+                    Clusters
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.48" data-path="ha.html">
+            
+                <a href="ha.html">
+            
+                    
+                    High Availability and Failover
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.49" data-path="graceful-shutdown.html">
+            
+                <a href="graceful-shutdown.html">
+            
+                    
+                    Graceful Server Shutdown
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.50" data-path="libaio.html">
+            
+                <a href="libaio.html">
+            
+                    
+                    Libaio Native Libraries
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.51" data-path="thread-pooling.html">
+            
+                <a href="thread-pooling.html">
+            
+                    
+                    Thread management
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.52" data-path="logging.html">
+            
+                <a href="logging.html">
+            
+                    
+                    Logging
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.53" data-path="rest.html">
+            
+                <a href="rest.html">
+            
+                    
+                    REST Interface
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.54" data-path="embedding-activemq.html">
+            
+                <a href="embedding-activemq.html">
+            
+                    
+                    Embedding Apache ActiveMQ Artemis
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.55" data-path="karaf.html">
+            
+                <a href="karaf.html">
+            
+                    
+                    Apache Karaf
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.56" data-path="spring-integration.html">
+            
+                <a href="spring-integration.html">
+            
+                    
+                    Spring Integration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.57" data-path="cdi-integration.html">
+            
+                <a href="cdi-integration.html">
+            
+                    
+                    CDI Integration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.58" data-path="intercepting-operations.html">
+            
+                <a href="intercepting-operations.html">
+            
+                    
+                    Intercepting Operations
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.59" data-path="protocols-interoperability.html">
+            
+                <a href="protocols-interoperability.html">
+            
+                    
+                    Protocols and Interoperability
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.60" data-path="tools.html">
+            
+                <a href="tools.html">
+            
+                    
+                    Tools
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.61" data-path="maven-plugin.html">
+            
+                <a href="maven-plugin.html">
+            
+                    
+                    Maven Plugin
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.62" data-path="unit-testing.html">
+            
+                <a href="unit-testing.html">
+            
+                    
+                    Unit Testing
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.63" data-path="perf-tuning.html">
+            
+                <a href="perf-tuning.html">
+            
+                    
+                    Troubleshooting and Performance Tuning
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.64" data-path="configuration-index.html">
+            
+                <a href="configuration-index.html">
+            
+                    
+                    Configuration Reference
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.65" data-path="updating-artemis.html">
+            
+                <a href="updating-artemis.html">
+            
+                    
+                    Updating Artemis
+            
+                </a>
+            
+
+            
+        </li>
+    
+
+    
+
+    <li class="divider"></li>
+
+    <li>
+        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
+            Published with GitBook
+        </a>
+    </li>
+</ul>
+
+
+                </nav>
+            
+        
+    </div>
+
+    <div class="book-body">
+        
+            <div class="body-inner">
+                
+                    
+
+<div class="book-header" role="navigation">
+    
+
+    <!-- Title -->
+    <h1>
+        <i class="fa fa-circle-o-notch fa-spin"></i>
+        <a href="." >Management</a>
+    </h1>
+</div>
+
+
+
+
+                    <div class="page-wrapper" tabindex="-1" role="main">
+                        <div class="page-inner">
+                            
+<div id="book-search-results">
+    <div class="search-noresults">
+    
+                                <section class="normal markdown-section">
+                                
+                                <h1 id="management">Management</h1>
+<p>Apache ActiveMQ Artemis has an extensive <em>management API</em> that allows a user to modify a
+server configuration, create new resources (e.g. addresses and queues),
+inspect these resources (e.g. how many messages are currently held in a
+queue) and interact with it (e.g. to remove messages from a queue). Apache ActiveMQ Artemis 
+also allows clients to subscribe to management notifications.</p>
+<p>There are four ways to access Apache ActiveMQ Artemis management API:</p>
+<ul>
+<li><p>Using JMX -- <em>JMX</em> is the standard way to manage Java applications</p>
+</li>
+<li><p>Using Jolokia -- Jolokia exposes the JMX API of an application through a <em>REST interface</em></p>
+</li>
+<li><p>Using the Core Client -- management operations are sent to Apache ActiveMQ Artemis
+server using <em>Core Client messages</em></p>
+</li>
+<li><p>Using the Core JMS Client -- management operations are sent to Apache ActiveMQ Artemis
+server using <em>Core JMS Client messages</em></p>
+</li>
+</ul>
+<p>Although there are four different ways to manage Apache ActiveMQ Artemis, each API supports
+the same functionality. If it is possible to manage a resource using JMX
+it is also possible to achieve the same result using Core messages.</p>
+<p>Besides the programmatic management interfaces, a <em>Web Console</em> and a Command Line
+<em>management utility</em> are also available to administrators of ActiveMQ Artemis.</p>
+<p>The choice depends on your requirements, your application settings and
+your environment to decide which way suits you best.</p>
+<blockquote>
+<p><strong>Note</strong></p>
+<p>In version 2 of Apache ActiveMQ Artemis the syntax used for MBean Object names has changed significantly due to changes
+in the addressing scheme. See the documentation for each individual resource for details on the new syntax.</p>
+</blockquote>
+<h2 id="the-management-api">The Management API</h2>
+<p>Regardless of the way you <em>invoke</em> management operations, the management
+API is the same.</p>
+<p>For each <em>managed resource</em>, there exists a Java interface describing
+what operations can be invoked for this type of resource.</p>
+<p>To learn about available <em>management operations</em>, see the Javadoc
+for these interfaces. They are located in the
+<code>org.apache.activemq.artemis.api.core.management</code> package and they are named
+with the word <code>Control</code> at the end.</p>
+<p>The way to invoke management operations depends on whether JMX, Core
+messages, or Core JMS messages are used.</p>
+<h3 id="apache-activemq-artemis-management-api">Apache ActiveMQ Artemis Management API</h3>
+<p>For full details of the API please consult the Javadoc. In summary:</p>
+<h4 id="apache-activemq-artemis-server-management">Apache ActiveMQ Artemis Server Management</h4>
+<p>The <code>ActiveMQServerControl</code> interface is the entry point for broker management.</p>
+<ul>
+<li><p>Listing, creating, deploying and destroying queues</p>
+<p>A list of deployed queues can be retrieved using the
+<code>getQueueNames()</code> method.</p>
+<p>Queues can be created or destroyed using the management
+operations <code>createQueue()</code> or <code>deployQueue()</code> or <code>destroyQueue()</code></p>
+<p><code>createQueue</code> will fail if the queue already exists while
+<code>deployQueue</code> will do nothing.</p>
+</li>
+<li><p>Listing and closing remote connections</p>
+<p>Client&apos;s remote addresses can be retrieved using
+<code>listRemoteAddresses()</code>. It is also possible to close the
+connections associated with a remote address using the
+<code>closeConnectionsForAddress()</code> method.</p>
+<p>Alternatively, connection IDs can be listed using
+<code>listConnectionIDs()</code> and all the sessions for a given connection ID
+can be listed using <code>listSessions()</code>.</p>
+</li>
+<li><p>Transaction heuristic operations</p>
+<p>In case of a server crash, when the server restarts, it it possible
+that some transaction requires manual intervention. The
+<code>listPreparedTransactions()</code> method lists the transactions which are
+in the prepared states (the transactions are represented as opaque
+Base64 Strings.) To commit or rollback a given prepared transaction,
+the <code>commitPreparedTransaction()</code> or <code>rollbackPreparedTransaction()</code>
+method can be used to resolve heuristic transactions. Heuristically
+completed transactions can be listed using the
+<code>listHeuristicCommittedTransactions()</code> and
+<code>listHeuristicRolledBackTransactions</code> methods.</p>
+</li>
+<li><p>Enabling and resetting Message counters</p>
+<p>Message counters can be enabled or disabled using the
+<code>enableMessageCounters()</code> or <code>disableMessageCounters()</code> method. To
+reset message counters, it is possible to invoke
+<code>resetAllMessageCounters()</code> and <code>resetAllMessageCounterHistories()</code>
+methods.</p>
+</li>
+<li><p>Retrieving the server configuration and attributes</p>
+<p>The <code>ActiveMQServerControl</code> exposes Apache ActiveMQ Artemis server configuration
+through all its attributes (e.g. <code>getVersion()</code> method to retrieve
+the server&apos;s version, etc.)</p>
+</li>
+<li><p>Listing, creating and destroying Core bridges and diverts</p>
+<p>A list of deployed core bridges (resp. diverts) can be retrieved
+using the <code>getBridgeNames()</code> (resp. <code>getDivertNames()</code>) method.</p>
+<p>Core bridges (resp. diverts) can be created or destroyed using the
+management operations <code>createBridge()</code> and <code>destroyBridge()</code> (resp.
+<code>createDivert()</code> and <code>destroyDivert()</code>).</p>
+</li>
+<li><p>It is possible to stop the server and force failover to occur with
+any currently attached clients.</p>
+<p>To do this use the <code>forceFailover()</code> operation. </p>
+<blockquote>
+<p><strong>Note</strong></p>
+<p>Since this method actually stops the server you will probably
+receive some sort of error depending on which management service
+you use to call it.</p>
+</blockquote>
+</li>
+</ul>
+<h4 id="address-management">Address Management</h4>
+<p>Individual addresses can be managed using the <code>AddressControl</code> interface.</p>
+<ul>
+<li><p>Modifying roles and permissions for an address</p>
+<p>You can add or remove roles associated to a queue using the
+<code>addRole()</code> or <code>removeRole()</code> methods. You can list all the roles
+associated to the queue with the <code>getRoles()</code> method</p>
+</li>
+</ul>
+<h4 id="queue-management">Queue Management</h4>
+<p>The bulk of the management API deals with queues. The
+<code>QueueControl</code> interface defines the queue management operations.</p>
+<p>Most of the management operations on queues take either a single message
+ID (e.g. to remove a single message) or a filter (e.g. to expire all
+messages with a given property.)</p>
+<blockquote>
+<p><strong>Note</strong></p>
+<p>Passing <code>null</code> or an empty string in the <code>filter</code> parameter means that
+the management operation will be performed on <em>all messages</em> in a queue.</p>
+</blockquote>
+<ul>
+<li><p>Expiring, sending to a dead letter address and moving messages</p>
+<p>Messages can be expired from a queue by using the <code>expireMessages()</code>
+method. If an expiry address is defined, messages will be sent to
+it, otherwise they are discarded. The queue&apos;s expiry address can be
+set with the <code>setExpiryAddress()</code> method.</p>
+<p>Messages can also be sent to a dead letter address with the
+<code>sendMessagesToDeadLetterAddress()</code> method. It returns the number of
+messages which are sent to the dead letter address. If a dead letter
+address is not defined, message are removed from the queue and
+discarded. The queue&apos;s dead letter address can be set with the
+<code>setDeadLetterAddress()</code> method.</p>
+<p>Messages can also be moved from a queue to another queue by using
+the <code>moveMessages()</code> method.</p>
+</li>
+<li><p>Listing and removing messages</p>
+<p>Messages can be listed from a queue by using the <code>listMessages()</code>
+method which returns an array of <code>Map</code>, one <code>Map</code> for each message.</p>
+<p>Messages can also be removed from the queue by using the
+<code>removeMessages()</code> method which returns a <code>boolean</code> for the single
+message ID variant or the number of removed messages for the filter
+variant. The <code>removeMessages()</code> method takes a <code>filter</code> argument to
+remove only filtered messages. Setting the filter to an empty string
+will in effect remove all messages.</p>
+</li>
+<li><p>Counting messages</p>
+<p>The number of messages in a queue is returned by the
+<code>getMessageCount()</code> method. Alternatively, the <code>countMessages()</code>
+will return the number of messages in the queue which <em>match a given
+filter</em>.</p>
+</li>
+<li><p>Changing message priority</p>
+<p>The message priority can be changed by using the
+<code>changeMessagesPriority()</code> method which returns a <code>boolean</code> for the
+single message ID variant or the number of updated messages for the
+filter variant.</p>
+</li>
+<li><p>Message counters</p>
+<p>Message counters can be listed for a queue with the
+<code>listMessageCounter()</code> and <code>listMessageCounterHistory()</code> methods
+(see Message Counters section). The message counters can also be
+reset for a single queue using the <code>resetMessageCounter()</code> method.</p>
+</li>
+<li><p>Retrieving the queue attributes</p>
+<p>The <code>QueueControl</code> exposes queue settings through its
+attributes (e.g. <code>getFilter()</code> to retrieve the queue&apos;s filter if it
+was created with one, <code>isDurable()</code> to know whether the queue is
+durable or not, etc.)</p>
+</li>
+<li><p>Pausing and resuming Queues</p>
+<p>The <code>QueueControl</code> can pause and resume the underlying queue. When a
+queue is paused, it will receive messages but will not deliver them.
+When it&apos;s resumed, it&apos;ll begin delivering the queued messages, if
+any.</p>
+</li>
+</ul>
+<h4 id="other-resources-management">Other Resources Management</h4>
+<p>Apache ActiveMQ Artemis allows to start and stop its remote resources (acceptors,
+diverts, bridges, etc.) so that a server can be taken off line for a
+given period of time without stopping it completely (e.g. if other
+management operations must be performed such as resolving heuristic
+transactions). These resources are:</p>
+<ul>
+<li><p>Acceptors</p>
+<p>They can be started or stopped using the <code>start()</code> or. <code>stop()</code>
+method on the <code>AcceptorControl</code> interface. The acceptors parameters
+can be retrieved using the <code>AcceptorControl</code> attributes (see <a href="configuring-transports.html">Understanding Acceptors</a>)</p>
+</li>
+<li><p>Diverts</p>
+<p>They can be started or stopped using the <code>start()</code> or <code>stop()</code>
+method on the <code>DivertControl</code> interface. Diverts
+parameters can be retrieved using the <code>DivertControl</code> attributes
+(see <a href="diverts.html">Diverting and Splitting Message Flows)</a>)</p>
+</li>
+<li><p>Bridges</p>
+<p>They can be started or stopped using the <code>start()</code> (resp. <code>stop()</code>)
+method on the <code>BridgeControl</code> interface. Bridges parameters can be retrieved
+using the <code>BridgeControl</code> attributes (see <a href="core-bridges.html">Core bridges</a>)</p>
+</li>
+<li><p>Broadcast groups</p>
+<p>They can be started or stopped using the <code>start()</code> or <code>stop()</code>
+method on the <code>BroadcastGroupControl</code> interface. Broadcast groups
+parameters can be retrieved using the <code>BroadcastGroupControl</code>
+attributes (see <a href="clusters.html">Clusters</a>)</p>
+</li>
+<li><p>Cluster connections</p>
+<p>They can be started or stopped using the <code>start()</code> or <code>stop()</code>
+method on the <code>ClusterConnectionControl</code> interface. Cluster
+connections parameters can be retrieved using the
+<code>ClusterConnectionControl</code> attributes (see <a href="clusters.html">Clusters</a>)</p>
+</li>
+</ul>
+<h2 id="using-management-via-jmx">Using Management Via JMX</h2>
+<p>Apache ActiveMQ Artemis can be managed using
+<a href="http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html" target="_blank">JMX</a>.</p>
+<p>The management API is exposed by Apache ActiveMQ Artemis using MBeans interfaces.
+Apache ActiveMQ Artemis registers its resources with the domain <code>org.apache.activemq.artemis</code>.</p>
+<p>For example, the <code>ObjectName</code> to manage the anycast queue <code>exampleQueue</code> on the address <code>exampleAddress</code> is:</p>
+<pre><code>org.apache.activemq.artemis:broker=&lt;brokerName&gt;,component=addresses,address=&quot;exampleAddress&quot;,subcomponent=queues,routing-type=&quot;anycast&quot;,queue=&quot;exampleQueue&quot;
+</code></pre><p>and the MBean is:</p>
+<pre><code>org.apache.activemq.artemis.api.core.management.QueueControl
+</code></pre><p>The MBean <code>ObjectName</code>&apos;s are built using the helper class
+<code>org.apache.activemq.artemis.api.core.management.ObjectNameBuilder</code>. You can
+also use <code>jconsole</code> to find the <code>ObjectName</code> of the MBean you want to
+manage.</p>
+<p>Example usage of the <code>ObjectNameBuilder</code> to obtain <code>ActiveMQServerControl</code>&apos;s name:</p>
+<pre><code class="lang-java">brokerName = <span class="hljs-string">&quot;0.0.0.0&quot;</span>;  <span class="hljs-comment">// configured e.g. in broker.xml &lt;broker-name&gt; element</span>
+objectNameBuilder = ObjectNameBuilder.create(ArtemisResolver.DEFAULT_DOMAIN, brokerName, <span class="hljs-keyword">true</span>);
+serverObjectName = objectNameBuilder.getActiveMQServerObjectName()
+</code></pre>
+<p>Managing Apache ActiveMQ Artemis using JMX is identical to management of any Java
+Applications using JMX. It can be done by reflection or by creating
+proxies of the MBeans.</p>
+<h3 id="configuring-jmx">Configuring JMX</h3>
+<p>By default, JMX is enabled to manage Apache ActiveMQ Artemis. It can be disabled by
+setting <code>jmx-management-enabled</code> to <code>false</code> in
+<code>broker.xml</code>:</p>
+<pre><code>&lt;!-- false to disable JMX management for Apache ActiveMQ Artemis --&gt;
+&lt;jmx-management-enabled&gt;false&lt;/jmx-management-enabled&gt;
+</code></pre><p>If JMX is enabled, Apache ActiveMQ Artemis can be managed locally using <code>jconsole</code>.</p>
+<blockquote>
+<p><strong>Note</strong></p>
+<p>Remote connections to JMX are not enabled by default for security
+reasons. Please refer to <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html" target="_blank">Java Management
+guide</a>
+to configure the server for remote management (system properties must
+be set in <code>artemis.profile</code>).</p>
+</blockquote>
+<p>By default, Apache ActiveMQ Artemis server uses the JMX domain &quot;org.apache.activemq.artemis&quot;.
+To manage several Apache ActiveMQ Artemis servers from the <em>same</em> MBeanServer, the JMX
+domain can be configured for each individual Apache ActiveMQ Artemis server by setting
+<code>jmx-domain</code> in <code>broker.xml</code>:</p>
+<pre><code>&lt;!-- use a specific JMX domain for ActiveMQ Artemis MBeans --&gt;
+&lt;jmx-domain&gt;my.org.apache.activemq&lt;/jmx-domain&gt;
+</code></pre><h4 id="mbeanserver-configuration">MBeanServer configuration</h4>
+<p>When Apache ActiveMQ Artemis is run in standalone, it uses the Java Virtual Machine&apos;s
+<code>Platform MBeanServer</code> to register its MBeans. By default, <a href="http://www.jolokia.org/" target="_blank">Jolokia</a>
+is also deployed to allow access to the MBean server via <a href="https://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank">REST</a>.</p>
+<h3 id="example">Example</h3>
+<p>See the <a href="examples.html">Examples</a> chapter for an example which shows how to use a remote connection to JMX
+and MBean proxies to manage Apache ActiveMQ Artemis.</p>
+<h3 id="exposing-jmx-using-jolokia">Exposing JMX using Jolokia</h3>
+<p>The default Broker configuration ships with the <a href="http://www.jolokia.org" target="_blank">Jolokia</a>
+HTTP agent deployed as a Web Application. Jolokia is a remote
+JMX-over-HTTP bridge that exposes MBeans. For a full guide as
+to how to use it refer to <a href="http://www.jolokia.org/documentation.html" target="_blank">Jolokia Documentation</a>,
+however a simple example to query the broker&apos;s version would
+be to use a browser and go to the URL <a href="">http://localhost:8161/jolokia/read/org.apache.activemq.artemis:broker=&quot;0.0.0.0&quot;/Version</a>.</p>
+<p>This would give you back something like the following:</p>
+<pre><code>{&quot;request&quot;:{&quot;mbean&quot;:&quot;org.apache.activemq.artemis:broker=\&quot;0.0.0.0\&quot;&quot;,&quot;attribute&quot;:&quot;Version&quot;,&quot;type&quot;:&quot;read&quot;},&quot;value&quot;:&quot;2.0.0-SNAPSHOT&quot;,&quot;timestamp&quot;:1487017918,&quot;status&quot;:200}
+</code></pre><h2 id="using-management-via-apache-activemq-artemis-api">Using Management Via Apache ActiveMQ Artemis API</h2>
+<p>The management API in ActiveMQ Artemis is accessed by sending Core Client messages
+to a special address, the <em>management address</em>.</p>
+<p><em>Management messages</em> are regular Core Client messages with well-known
+properties that the server needs to understand to interact with the
+management API:</p>
+<ul>
+<li><p>The name of the managed resource</p>
+</li>
+<li><p>The name of the management operation</p>
+</li>
+<li><p>The parameters of the management operation</p>
+</li>
+</ul>
+<p>When such a management message is sent to the management address,
+Apache ActiveMQ Artemis server will handle it, extract the information, invoke the
+operation on the managed resources and send a <em>management reply</em> to the
+management message&apos;s reply-to address (specified by
+<code>ClientMessageImpl.REPLYTO_HEADER_NAME</code>).</p>
+<p>A <code>ClientConsumer</code> can be used to consume the management reply and
+retrieve the result of the operation (if any) stored in the reply&apos;s
+body. For portability, results are returned as a <a href="http://json.org" target="_blank">JSON</a>
+String rather than Java Serialization (the
+<code>org.apache.activemq.artemis.api.core.management.ManagementHelper</code> can be used
+to convert the JSON string to Java objects).</p>
+<p>These steps can be simplified to make it easier to invoke management
+operations using Core messages:</p>
+<ol>
+<li><p>Create a <code>ClientRequestor</code> to send messages to the management
+address and receive replies</p>
+</li>
+<li><p>Create a <code>ClientMessage</code></p>
+</li>
+<li><p>Use the helper class
+<code>org.apache.activemq.artemis.api.core.management.ManagementHelper</code> to fill
+the message with the management properties</p>
+</li>
+<li><p>Send the message using the <code>ClientRequestor</code></p>
+</li>
+<li><p>Use the helper class
+<code>org.apache.activemq.artemis.api.core.management.ManagementHelper</code> to
+retrieve the operation result from the management reply</p>
+</li>
+</ol>
+<p>For example, to find out the number of messages in the queue
+<code>exampleQueue</code>:</p>
+<pre><code class="lang-java">ClientSession session = ...
+ClientRequestor requestor = <span class="hljs-keyword">new</span> ClientRequestor(session, <span class="hljs-string">&quot;activemq.management&quot;</span>);
+ClientMessage message = session.createMessage(<span class="hljs-keyword">false</span>);
+ManagementHelper.putAttribute(message, <span class="hljs-string">&quot;queue.exampleQueue&quot;</span>, <span class="hljs-string">&quot;messageCount&quot;</span>);
+session.start();
+ClientMessage reply = requestor.request(m);
+<span class="hljs-keyword">int</span> count = (Integer) ManagementHelper.getResult(reply);
+System.out.println(<span class="hljs-string">&quot;There are &quot;</span> + count + <span class="hljs-string">&quot; messages in exampleQueue&quot;</span>);
+</code></pre>
+<p>Management operation name and parameters must conform to the Java
+interfaces defined in the <code>management</code> packages.</p>
+<p>Names of the resources are built using the helper class
+<code>org.apache.activemq.artemis.api.core.management.ResourceNames</code> and are
+straightforward (e.g. <code>queue.exampleQueue</code> for <code>QueueControl</code> of the Queue
+<code>exampleQueue</code>, or <code>broker</code> for the <code>ActiveMQServerControl</code>).</p>
+<blockquote>
+<p><em>NOTE</em></p>
+<p>The <code>ManagementHelper</code> class can be used only with Core JMS messages.
+When called with a message from a different JMS library, an exception will be thrown.</p>
+</blockquote>
+<h3 id="configuring-management">Configuring Management</h3>
+<p>The management address to send management messages is configured in
+<code>broker.xml</code>:</p>
+<pre><code>&lt;management-address&gt;activemq.management&lt;/management-address&gt;
+</code></pre><p>By default, the address is <code>activemq.management</code>.</p>
+<p>The management address requires a <em>special</em> user permission <code>manage</code> to
+be able to receive and handle management messages. This is also
+configured in broker.xml:</p>
+<pre><code>&lt;!-- users with the admin role will be allowed to manage --&gt;
+&lt;!-- Apache ActiveMQ Artemis using management messages        --&gt;
+&lt;security-setting match=&quot;activemq.management&quot;&gt;
+   &lt;permission type=&quot;manage&quot; roles=&quot;admin&quot; /&gt;
+&lt;/security-setting&gt;
+</code></pre><h3 id="example">Example</h3>
+<p>See the <a href="examples.html">Examples</a> chapter for an example which shows
+how to use JMS messages to manage the Apache ActiveMQ Artemis server.</p>
+<h2 id="management-notifications">Management Notifications</h2>
+<p>Apache ActiveMQ Artemis emits <em>notifications</em> to inform listeners of potentially
+interesting events (creation of new resources, security violation,
+etc.).</p>
+<p>These notifications can be received by two different ways:</p>
+<ul>
+<li><p>JMX notifications</p>
+</li>
+<li><p>Notification messages</p>
+</li>
+</ul>
+<h3 id="jmx-notifications">JMX Notifications</h3>
+<p>If JMX is enabled (see Configuring JMX section), JMX notifications can be received by
+subscribing to <code>org.apache.activemq.artemis:type=Broker,brokerName=&lt;broker name&gt;,module=Core,serviceType=Server</code> for
+notifications on resources.</p>
+<h3 id="notification-messages">Notification Messages</h3>
+<p>Apache ActiveMQ Artemis defines a special <em>management notification address</em>. 
+Queues can be bound to this address so that clients will receive
+management notifications as messages.</p>
+<p>A client which wants to receive management notifications must
+create a queue bound to the management notification address. It can
+then receive the notifications from its queue.</p>
+<p>Notifications messages are regular messages with additional
+properties corresponding to the notification (its type, when it
+occurred, the resources which were concerned, etc.).</p>
+<p>Since notifications are regular messages, it is possible to use
+message selectors to filter out notifications and receives only a subset
+of all the notifications emitted by the server.</p>
+<h4 id="configuring-the-management-notification-address">Configuring The Management Notification Address</h4>
+<p>The management notification address to receive management notifications
+is configured in <code>broker.xml</code>:</p>
+<pre><code>&lt;management-notification-address&gt;activemq.notifications&lt;/management-notification-address&gt;
+</code></pre><p>By default, the address is <code>activemq.notifications</code>.</p>
+<h4 id="receiving-notification-messages">Receiving Notification Messages</h4>
+<p>Apache ActiveMQ Artemis&apos;s Core JMS Client can be used to receive notifications:</p>
+<pre><code class="lang-java">Topic notificationsTopic = ActiveMQJMSClient.createTopic(<span class="hljs-string">&quot;activemq.notifications&quot;</span>);
+
+Session session = ...
+MessageConsumer notificationConsumer = session.createConsumer(notificationsTopic);
+notificationConsumer.setMessageListener(<span class="hljs-keyword">new</span> MessageListener()
+{
+   <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onMessage</span><span class="hljs-params">(Message notif)</span>
+   </span>{
+      System.out.println(<span class="hljs-string">&quot;------------------------&quot;</span>);
+      System.out.println(<span class="hljs-string">&quot;Received notification:&quot;</span>);
+      <span class="hljs-keyword">try</span>
+      {
+         Enumeration propertyNames = notif.getPropertyNames();
+         <span class="hljs-keyword">while</span> (propertyNames.hasMoreElements())
+         {
+            String propertyName = (String)propertyNames.nextElement();
+            System.out.format(<span class="hljs-string">&quot;  %s: %s\n&quot;</span>, propertyName, notif.getObjectProperty(propertyName));
+         }
+      }
+      <span class="hljs-keyword">catch</span> (JMSException e)
+      {
+      }
+      System.out.println(<span class="hljs-string">&quot;------------------------&quot;</span>);
+   }
+});
+</code></pre>
+<h3 id="example">Example</h3>
+<p>See the <a href="examples.html">Examples</a> chapter for an example which shows how to use a JMS <code>MessageListener</code> to receive management notifications from ActiveMQ Artemis server.</p>
+<h3 id="notification-types-and-headers">Notification Types and Headers</h3>
+<p>Below is a list of all the different kinds of notifications as well as
+which headers are on the messages. Every notification has a
+<code>_AMQ_NotifType</code> (value noted in parentheses) and <code>_AMQ_NotifTimestamp</code>
+header. The timestamp is the un-formatted result of a call to
+<code>java.lang.System.currentTimeMillis()</code>.</p>
+<ul>
+<li><p><code>BINDING_ADDED</code> (0)</p>
+<p><code>_AMQ_Binding_Type</code>, <code>_AMQ_Address</code>, <code>_AMQ_ClusterName</code>,
+<code>_AMQ_RoutingName</code>, <code>_AMQ_Binding_ID</code>, <code>_AMQ_Distance</code>,
+<code>_AMQ_FilterString</code></p>
+</li>
+<li><p><code>BINDING_REMOVED</code> (1)</p>
+<p><code>_AMQ_Address</code>, <code>_AMQ_ClusterName</code>, <code>_AMQ_RoutingName</code>,
+<code>_AMQ_Binding_ID</code>, <code>_AMQ_Distance</code>, <code>_AMQ_FilterString</code></p>
+</li>
+<li><p><code>CONSUMER_CREATED</code> (2)</p>
+<p><code>_AMQ_Address</code>, <code>_AMQ_ClusterName</code>, <code>_AMQ_RoutingName</code>, <code>_AMQ_Distance</code>,
+<code>_AMQ_ConsumerCount</code>, <code>_AMQ_User</code>, <code>_AMQ_RemoteAddress</code>,
+<code>_AMQ_SessionName</code>, <code>_AMQ_FilterString</code></p>
+</li>
+<li><p><code>CONSUMER_CLOSED</code> (3)</p>
+<p><code>_AMQ_Address</code>, <code>_AMQ_ClusterName</code>, <code>_AMQ_RoutingName</code>, <code>_AMQ_Distance</code>,
+<code>_AMQ_ConsumerCount</code>, <code>_AMQ_User</code>, <code>_AMQ_RemoteAddress</code>,
+<code>_AMQ_SessionName</code>, <code>_AMQ_FilterString</code></p>
+</li>
+<li><p><code>SECURITY_AUTHENTICATION_VIOLATION</code> (6)</p>
+<p><code>_AMQ_User</code></p>
+</li>
+<li><p><code>SECURITY_PERMISSION_VIOLATION</code> (7)</p>
+<p><code>_AMQ_Address</code>, <code>_AMQ_CheckType</code>, <code>_AMQ_User</code></p>
+</li>
+<li><p><code>DISCOVERY_GROUP_STARTED</code> (8)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>DISCOVERY_GROUP_STOPPED</code> (9)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>BROADCAST_GROUP_STARTED</code> (10)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>BROADCAST_GROUP_STOPPED</code> (11)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>BRIDGE_STARTED</code> (12)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>BRIDGE_STOPPED</code> (13)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>CLUSTER_CONNECTION_STARTED</code> (14)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>CLUSTER_CONNECTION_STOPPED</code> (15)</p>
+<p><code>name</code></p>
+</li>
+<li><p><code>ACCEPTOR_STARTED</code> (16)</p>
+<p><code>factory</code>, <code>id</code></p>
+</li>
+<li><p><code>ACCEPTOR_STOPPED</code> (17)</p>
+<p><code>factory</code>, <code>id</code></p>
+</li>
+<li><p><code>PROPOSAL</code> (18)</p>
+<p><code>_JBM_ProposalGroupId</code>, <code>_JBM_ProposalValue</code>, <code>_AMQ_Binding_Type</code>,
+<code>_AMQ_Address</code>, <code>_AMQ_Distance</code></p>
+</li>
+<li><p><code>PROPOSAL_RESPONSE</code> (19)</p>
+<p><code>_JBM_ProposalGroupId</code>, <code>_JBM_ProposalValue</code>,
+<code>_JBM_ProposalAltValue</code>, <code>_AMQ_Binding_Type</code>, <code>_AMQ_Address</code>,
+<code>_AMQ_Distance</code></p>
+</li>
+<li><p><code>CONSUMER_SLOW</code> (21)</p>
+<p><code>_AMQ_Address</code>, <code>_AMQ_ConsumerCount</code>, <code>_AMQ_RemoteAddress</code>,
+<code>_AMQ_ConnectionName</code>, <code>_AMQ_ConsumerName</code>, <code>_AMQ_SessionName</code></p>
+</li>
+</ul>
+<h2 id="message-counters">Message Counters</h2>
+<p>Message counters can be used to obtain information on queues <em>over time</em>
+as Apache ActiveMQ Artemis keeps a history on queue metrics.</p>
+<p>They can be used to show <em>trends</em> on queues. For example, using the
+management API, it would be possible to query the number of messages in
+a queue at regular interval. However, this would not be enough to know
+if the queue is used: the number of messages can remain constant because
+nobody is sending or receiving messages from the queue or because there
+are as many messages sent to the queue than messages consumed from it.
+The number of messages in the queue remains the same in both cases but
+its use is widely different.</p>
+<p>Message counters give additional information about the queues:</p>
+<ul>
+<li><p><code>count</code></p>
+<p>The <em>total</em> number of messages added to the queue since the server
+was started</p>
+</li>
+<li><p><code>countDelta</code></p>
+<p>the number of messages added to the queue <em>since the last message
+counter update</em></p>
+</li>
+<li><p><code>messageCount</code></p>
+<p>The <em>current</em> number of messages in the queue</p>
+</li>
+<li><p><code>messageCountDelta</code></p>
+<p>The <em>overall</em> number of messages added/removed from the queue <em>since
+the last message counter update</em>. For example, if
+<code>messageCountDelta</code> is equal to <code>-10</code> this means that overall 10
+messages have been removed from the queue (e.g. 2 messages were
+added and 12 were removed)</p>
+</li>
+<li><p><code>lastAddTimestamp</code></p>
+<p>The timestamp of the last time a message was added to the queue</p>
+</li>
+<li><p><code>udpateTimestamp</code></p>
+<p>The timestamp of the last message counter update</p>
+</li>
+</ul>
+<p>These attributes can be used to determine other meaningful data as well.
+For example, to know specifically how many messages were <em>consumed</em> from
+the queue since the last update simply subtract the <code>messageCountDelta</code>
+from <code>countDelta</code>.</p>
+<h3 id="configuring-message-counters">Configuring Message Counters</h3>
+<p>By default, message counters are disabled as it might have a small
+negative effect on memory.</p>
+<p>To enable message counters, you can set it to <code>true</code> in
+<code>broker.xml</code>:</p>
+<pre><code>&lt;message-counter-enabled&gt;true&lt;/message-counter-enabled&gt;
+</code></pre><p>Message counters keep a history of the queue metrics (10 days by
+default) and sample all the queues at regular interval (10 seconds by
+default). If message counters are enabled, these values should be
+configured to suit your messaging use case in
+<code>broker.xml</code>:</p>
+<pre><code>&lt;!-- keep history for a week --&gt;
+&lt;message-counter-max-day-history&gt;7&lt;/message-counter-max-day-history&gt;
+&lt;!-- sample the queues every minute (60000ms) --&gt;
+&lt;message-counter-sample-period&gt;60000&lt;/message-counter-sample-period&gt;
+</code></pre><p>Message counters can be retrieved using the Management API. For example,
+to retrieve message counters on a queue using JMX:</p>
+<pre><code class="lang-java"><span class="hljs-comment">// retrieve a connection to Apache ActiveMQ Artemis&apos;s MBeanServer</span>
+MBeanServerConnection mbsc = ...
+QueueControlMBean queueControl = (QueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+   on,
+   QueueControl.class,
+   <span class="hljs-keyword">false</span>);
+<span class="hljs-comment">// message counters are retrieved as a JSON String</span>
+String counters = queueControl.listMessageCounter();
+<span class="hljs-comment">// use the MessageCounterInfo helper class to manipulate message counters more easily</span>
+MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);
+System.out.format(<span class="hljs-string">&quot;%s message(s) in the queue (since last sample: %s)\n&quot;</span>,
+messageCounter.getMessageCount(),
+messageCounter.getMessageCountDelta());
+</code></pre>
+<h3 id="example">Example</h3>
+<p>See the <a href="examples.html">Examples</a> chapter for an example which shows how to use message counters to retrieve information on a queue.</p>
+
+                                
+                                </section>
+                            
+    </div>
+    <div class="search-results">
+        <div class="has-results">
+            
+            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
+            <ul class="search-results-list"></ul>
+            
+        </div>
+        <div class="no-results">
+            
+            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
+            
+        </div>
+    </div>
+</div>
+
+                        </div>
+                    </div>
+                
+            </div>
+
+            
+                
+                <a href="pre-acknowledge.html" class="navigation navigation-prev " aria-label="Previous page: Extra Acknowledge Modes">
+                    <i class="fa fa-angle-left"></i>
+                </a>
+                
+                
+                <a href="management-console.html" class="navigation navigation-next " aria-label="Next page: Management Console">
+                    <i class="fa fa-angle-right"></i>
+                </a>
+                
+            
+        
+    </div>
+
+    <script>
+        var gitbook = gitbook || [];
+        gitbook.push(function() {
+            gitbook.page.hasChanged({"page":{"title":"Management","level":"1.37","depth":1,"next":{"title":"Management Console","level":"1.38","depth":1,"path":"management-console.md","ref":"management-console.md","articles":[]},"previous":{"title":"Extra Acknowledge Modes","level":"1.36","depth":1,"path":"pre-acknowledge.md","ref":"pre-acknowledge.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.c
 ss","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"apache/activemq-artemis","theme":"default","githubHost":"https://github.com/","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ActiveMQ Artemis Documentation","links":{"home":"http://activemq.apache.org/artemis","issues":"https://issues.apache.org/jira/browse/ARTEMIS","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis User Guide and Reference Documentation"},"file":{"path":"management.md","mtime":"2017-09-08T01:26:53.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2017-09-14T19:42:32.953Z"},"basePath":".","book":{"language":""}});
+        });
+    </script>
+</div>
+
+        
+    <script src="gitbook/gitbook.js"></script>
+    <script src="gitbook/theme.js"></script>
+    
+        
+        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-search/search.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
+        
+    
+
+    </body>
+</html>
+



Mime
View raw message