blob: 571028cfeb56cd34be6272387b4c330bbd622851 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ActiveMQ</title>
<link rel="icon" type="image/png" href="/assets/img/favicon.png">
<link rel="stylesheet" href="/css/main.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js" integrity="sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="container">
<!-- <a class="navbar-brand mr-auto" href="#"><img style="height: 50px" src="assets/img/apache-feather.png" /></a> -->
<a class="navbar-brand mr-auto" href="/"><img src="/assets/img/activemq_logo_black_small.png" style="height: 50px"/></a>
<button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="ml-auto collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active" href="/index.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link" id="navbarDropdownComponents" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Components</a>
<ul class="dropdown-menu dropdown-menu-center" aria-labelledby="navbarDropdownComponents">
<div class="row">
<div class="col-12">
<ul class="multi-column-dropdown">
<li class="nav-item"><a class="dropdown-item" href="/components/classic">ActiveMQ 5</a></li>
<li class="nav-item"><a class="dropdown-item" href="/components/artemis/">ActiveMQ Artemis</a></li>
<li class="nav-item"><a class="dropdown-item" href="/components/nms">NMS Clients</a></li>
<li class="nav-item"><a class="dropdown-item" href="/components/cms">CMS Client</a></li>
</ul>
</div>
</div>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link" id="navbarDropdownCommunity" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Contact</a>
<ul class="dropdown-menu dropdown-menu-center multi-column columns-1" aria-labelledby="navbarDropdownCommunity">
<div class="row">
<div class="col-12">
<ul class="multi-column-dropdown">
<li class="nav-item"><a class="dropdown-item" href="/contact#mailing">Mailing Lists</a></li>
<li class="nav-item"><a class="dropdown-item" href="/contact#chat">Chat</a></li>
<li class="nav-item"><a class="dropdown-item" href="/contact#issues">Report Issues</a></li>
<li class="nav-item"><a class="dropdown-item" href="/contact#contributing">Contributing</a></li>
<li class="nav-item"><a class="dropdown-item" href="/security-advisories.html">Security</a></li>
</ul>
</div>
</div>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link" id="navbarDropdownTeam" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Apache</a>
<ul class="dropdown-menu dropdown-menu-center multi-column columns-1" aria-labelledby="navbarDropdownTeam">
<div class="row">
<div class="col-sm-12">
<ul class="multi-column-dropdown">
<li class="nav-item"><a class="dropdown-item" href="https://www.apache.org">The Apache Software Foundation</a></li>
<li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/licenses/">License</a></li>
<li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
<li class="nav-item"><a class="dropdown-item" href="/security-advisories.html">Security</a></li>
<li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/events/current-event">Events</a></li>
<li class="nav-item"><a class="dropdown-item" href="https://people.apache.org/phonebook.html?pmc=activemq">PMC & Committers</a></li>
<li class="nav-item"><a class="dropdown-item" href="/team/reports">Board Reports</a></li>
</ul>
</div>
</div>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="content">
<div class="page-title-activemq5">
<div class="container">
<h1>Advisory Message</h1>
</div>
</div>
<div class="container" >
<div class="row" style="margin-top: 30px">
<div class="col-12 activemq5">
<p><a href="features">Features</a> &gt; <a href="message-features">Message Features</a> &gt; <a href="advisory-message">Advisory Message</a></p>
<p>ActiveMQ supports advisory messages which allows you to watch the system using regular JMS messages. Currently we have advisory messages that support:</p>
<ul>
<li>consumers, producers and connections starting and stopping</li>
<li>temporary destinations being created and destroyed</li>
<li>messages expiring on topics and queues</li>
<li>brokers sending messages to destinations with no consumers.</li>
<li>connections starting and stopping</li>
</ul>
<p>Advisory messages can be thought as some kind of administrative channel where you receive information regarding what is happening on your JMS provider along with what’s happening with producers, consumers and destinations. When you look at a broker via <a href="jmx">JMX</a> you will see the advisory topics prefixed with <code class="highlighter-rouge">ActiveMQ.Advisory.</code>.</p>
<p>Every Advisory has the message <strong>type</strong> <code class="highlighter-rouge">Advisory</code> and some predefined message properties:</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">originBrokerId</code></td>
<td><code class="highlighter-rouge">StringProperty</code></td>
<td>The id of the broker where the advisory originated.</td>
<td>5.x</td>
</tr>
<tr>
<td><code class="highlighter-rouge">originBrokerName</code></td>
<td><code class="highlighter-rouge">StringProperty</code></td>
<td>The name of the broker where the advisory originated.</td>
<td>5.x</td>
</tr>
<tr>
<td><code class="highlighter-rouge">originBrokerURL</code></td>
<td><code class="highlighter-rouge">StringProperty</code></td>
<td>The first URL of the broker where the advisory originated.</td>
<td>5.2</td>
</tr>
</tbody>
</table>
<p>In addition, some messages carry a <code class="highlighter-rouge">Command</code> object, which carries additional information about the nature of the advisory, e.g., a subscription to each of the destination returns an <code class="highlighter-rouge">ActiveMQMessage</code>. Specific <code class="highlighter-rouge">DataStructure</code> objects, e.g.,. <code class="highlighter-rouge">ConsumerInfo</code>, <code class="highlighter-rouge">ProducerInfo</code>, <code class="highlighter-rouge">ConnectionInfo</code> can be retrieved using <code class="highlighter-rouge">ActiveMQMessage.getDataStructure()</code>.</p>
<p>For example:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Destination advisoryDestination = AdvisorySupport.getProducerAdvisoryTopic(destination)
MessageConsumer consumer = session.createConsumer(advisoryDestination);
consumer.setMessageListener(this);
public void onMessage(Message msg){
if(msg instanceof ActiveMQMessage) {
try {
ActiveMQMessage aMsg = (ActiveMQMessage)msg;
ProducerInfo prod = (ProducerInfo) aMsg.getDataStructure();
}
catch(JMSException e) {
log.error("Failed to process message: " + msg);
}
}
}
</code></pre></div></div>
<h2 id="the-following-advisory-topics-are-supported">The following advisory topics are supported</h2>
<h3 id="client-based-advisories">Client based advisories</h3>
<blockquote>
<p><strong>Tip</strong></p>
<p>These are always generated.</p>
</blockquote>
<table>
<thead>
<tr>
<th>Advisory Topics</th>
<th>Description</th>
<th>Properties</th>
<th>Data Structure</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Connection</code></td>
<td>Connection start &amp; stop messages.</td>
<td> </td>
<td><code class="highlighter-rouge">ConnectionInfo</code><code class="highlighter-rouge">RemoveInfo</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Producer.Queue</code></td>
<td>Producer start &amp; stop messages on a Queue.</td>
<td><code class="highlighter-rouge">String='producerCount'</code> - the number of producers</td>
<td><code class="highlighter-rouge">ProducerInfo</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Producer.Topic</code></td>
<td>Producer start &amp; stop messages on a Topic.</td>
<td><code class="highlighter-rouge">String='producerCount'</code> - the number of producers</td>
<td><code class="highlighter-rouge">ProducerInfo</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Consumer.Queue</code></td>
<td>Consumer start &amp; stop messages on a Queue.</td>
<td><code class="highlighter-rouge">String='consumerCount'</code> - the number of Consumers</td>
<td><code class="highlighter-rouge">ConnectionInfo</code><code class="highlighter-rouge">RemoveInfo</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Consumer.Topic</code></td>
<td>Consumer start &amp; stop messages on a Topic.</td>
<td><code class="highlighter-rouge">String='consumerCount'</code> - the number of Consumers</td>
<td><code class="highlighter-rouge">ConnectionInfo</code><code class="highlighter-rouge">RemoveInfo</code></td>
</tr>
</tbody>
</table>
<p>Note that the consumer start/stop advisory messages also have a <code class="highlighter-rouge">consumerCount</code> header to indicate the number of active consumers on the destination when the advisory message was sent. This means you can use the following selector to be notified when there are no active consumers on a given destination:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>consumerCount = 0
</code></pre></div></div>
<h3 id="destination-and-message-based-advisories">Destination and Message based advisories</h3>
<table>
<thead>
<tr>
<th>Advisory Topics</th>
<th>Description</th>
<th>Properties</th>
<th>Data Structure</th>
<th>Default</th>
<th>PolicyEntry Property</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Queue</code></td>
<td>Queue create &amp; destroy.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">DestinationInfo</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Topic</code></td>
<td>Topic create &amp; destroy.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">DestinationInfo</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.TempQueue</code></td>
<td>Temporary Queue create &amp; destroy.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">DestinationInfo</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.TempTopic</code></td>
<td>Temporary Topic create &amp; destroy.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">DestinationInfo</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Expired.Queue</code></td>
<td>Expired messages on a Queue.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the expired id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.Expired.Topic</code></td>
<td>Expired messages on a Topic.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the expired id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.NoConsumer.Queue</code></td>
<td>No consumer is available to process messages being sent on a Queue.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">sendAdvisoryIfNoConsumers</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.NoConsumer.Topic</code></td>
<td>No consumer is available to process messages being sent on a Topic.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">sendAdvisoryIfNoConsumers</code></td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>Tip</strong></p>
<p><code class="highlighter-rouge">NoConsumer</code> topic advisories are sent only for non-persistent messages.</p>
</blockquote>
<h3 id="new-advisories-in-version-52">New advisories in version 5.2</h3>
<table>
<thead>
<tr>
<th>Advisory Topics</th>
<th>Description</th>
<th>Properties</th>
<th>Data Structure</th>
<th>Default</th>
<th>PolicyEntry Property</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.SlowConsumer.Queue</code></td>
<td>Slow Queue Consumer.</td>
<td><code class="highlighter-rouge">String='consumerId'</code> - the consumer id</td>
<td><code class="highlighter-rouge">ConsumerInfo</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForSlowConsumers</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.SlowConsumer.Topic</code></td>
<td>Slow Topic Consumer.</td>
<td><code class="highlighter-rouge">String='consumerId'</code> - the consumer id</td>
<td><code class="highlighter-rouge">ConsumerInfo</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForSlowConsumers</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.FastProducer.Queue</code></td>
<td>Fast Queue producer.</td>
<td><code class="highlighter-rouge">String='producerId'</code> - the producer id</td>
<td><code class="highlighter-rouge">ProducerInfo</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisdoryForFastProducers</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory. FastProducer.Topic</code></td>
<td>Fast Topic producer.</td>
<td><code class="highlighter-rouge">String='consumerId'</code>’ - the producer id</td>
<td><code class="highlighter-rouge">ProducerInfo</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisdoryForFastProducers</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageDiscarded.Queue</code></td>
<td>Message discarded.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the discarded id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForDiscardingMessages</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageDiscarded.Topic</code></td>
<td>Message discarded.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the discarded id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForDiscardingMessages</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageDelivered.Queue</code></td>
<td>Message delivered to the broker.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForDelivery</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageDelivered.Topic</code></td>
<td>Message delivered to the broker.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForDelivery</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageConsumed.Queue</code></td>
<td>Message consumed by a client.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForConsumed</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageConsumed.Topic</code></td>
<td>Message consumed by a client.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryForConsumed</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.FULL</code></td>
<td>A Usage resource is at its limit.</td>
<td><code class="highlighter-rouge">String='usageName'</code> - the name of Usage resource</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">false</code></td>
<td><code class="highlighter-rouge">advisoryWhenFull</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MasterBroker</code></td>
<td>A broker is now the master in a master/slave configuration.</td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">null</code></td>
<td><code class="highlighter-rouge">true</code></td>
<td><code class="highlighter-rouge">none</code></td>
</tr>
</tbody>
</table>
<h3 id="new-advisories-in-54">New Advisories in 5.4</h3>
<table>
<thead>
<tr>
<th>Advisory Topics</th>
<th>Description</th>
<th>Properties</th>
<th>Data Structure</th>
<th>Default</th>
<th>PolicyEntry Property</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageDLQd.Queue</code></td>
<td>Message sent to DLQ.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td>Always on</td>
<td><code class="highlighter-rouge">advisoryForConsumed</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.MessageDLQd.Topic</code></td>
<td>Message sent to DLQ.</td>
<td><code class="highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="highlighter-rouge">Message</code></td>
<td>Always on</td>
<td><code class="highlighter-rouge">advisoryForConsumed</code></td>
</tr>
</tbody>
</table>
<h3 id="network-bridge-advisories">Network bridge advisories</h3>
<p>Starting with ActiveMQ version 5.5 you can watch advisory topics for events related to the status of network bridges. You can get advisory messages when the network bridge is started or stopped.</p>
<table>
<thead>
<tr>
<th>Advisory Topics</th>
<th>Description</th>
<th>Properties</th>
<th>Data Structure</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">ActiveMQ.Advisory.NetworkBridge</code></td>
<td>Network bridge being stopped or started.</td>
<td><code class="highlighter-rouge">Boolean="started"</code> - <code class="highlighter-rouge">true</code> if bridge is started, <code class="highlighter-rouge">false</code> if it is stopped. <code class="highlighter-rouge">Boolean="createdByDuplex"</code> - <code class="highlighter-rouge">true</code> if the bridge is created by remote network connector.</td>
<td><code class="highlighter-rouge">BrokerInfo</code> - provides data of the remote broker</td>
<td>Always on</td>
</tr>
</tbody>
</table>
<h3 id="enabling-advisories-disabled-by-default">Enabling Advisories Disabled by Default</h3>
<p>The advisories that are not turned on by default (see the last column) can be enabled on a <code class="highlighter-rouge">PolicyEntry</code> in the ActiveMQ Broker Configuration, e.g., to enable a message consumed advisory you can configure the following:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;destinationPolicy&gt;
&lt;policyMap&gt;
&lt;policyEntries&gt;
&lt;policyEntry topic="&gt;" advisoryForConsumed="true"/&gt;
&lt;/policyEntries&gt;
&lt;/policyMap&gt;
&lt;/destinationPolicy&gt;
</code></pre></div></div>
<blockquote>
<p>Hint</p>
<p>The <code class="highlighter-rouge">&gt;</code> character matches all topics - you can use wild-card matches for setting a destination policy - see <a href="wildcards">Wildcards</a></p>
</blockquote>
<h3 id="disabling-advisory-messages">Disabling Advisory Messages</h3>
<p>The use of advisory messages incurs a small overhead in terms of memory and connection resources that is related to the number of destinations in your system. In some cases it can make sense to disable all advisories.</p>
<p>Advisories need to be disabled both on the Broker, via XML Configuration</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;broker advisorySupport="false"&gt;
</code></pre></div></div>
<p>or from java code:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>BrokerService broker = new BrokerService();
broker.setAdvisorySupport(false);
// ...
broker.start();
</code></pre></div></div>
<p><em>and</em> on your <code class="highlighter-rouge">ActiveMQConnectionFactory</code> (because a subscription to an advisory topic will auto create it) via the <code class="highlighter-rouge">brokerUrl</code>:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tcp://localhost:61616?jms.watchTopicAdvisories=false
</code></pre></div></div>
<p>or via java code using the <code class="highlighter-rouge">watchTopicAdvisories</code> attribute on the <code class="highlighter-rouge">ActiveMQConnectionFactory</code>.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
factory.setWatchTopicAdvisories(false);
</code></pre></div></div>
<blockquote>
<p><strong>Warning</strong></p>
<p>Advisory messages are required for <a href="networks-of-brokers">dynamic network broker topologies</a> as <code class="highlighter-rouge">NetworkConnectors</code> subscribe to advisory messages. In the absence of advisories, a network must be statically configured.</p>
</blockquote>
<h3 id="using-the-destinations">Using the Destinations</h3>
<p>All of the above destinations are really prefixes which are appended with important information (like the actual topic or queue, the client ID, producer ID, consumer ID etc). This allows you to reuse the power of publish/subscribe, <a href="wildcards">Wildcards</a> and <a href="selectors">Selectors</a> to filter the advisory messages as you see fit.</p>
<p>For example if you want to subscribe to expired messages on a topic <code class="highlighter-rouge">FOO.BAR</code> you could subscribe to <code class="highlighter-rouge">ActiveMQ.Advisory.Expired.Topic.FOO.BAR</code>. To subscribe to all messages of a certain kind of advisory just append <code class="highlighter-rouge">.&gt;</code> to the topic, e.g., to subscribe to all the consumers starting and stopping to topics and queues subscribe to <code class="highlighter-rouge">ActiveMQ.Advisory.Consumer..&gt;</code>.</p>
<h3 id="helper-methods">Helper Methods</h3>
<p>Methods to get the advisory destination objects are available in <a href="http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/advisory/AdvisorySupport.html">AdvisorySupport</a> through the following methods.</p>
<ul>
<li>AdvisorySupport.getConsumerAdvisoryTopic()</li>
<li>AdvisorySupport.getProducerAdvisoryTopic()</li>
<li>AdvisorySupport.getExpiredTopicMessageAdvisoryTopic()</li>
<li>AdvisorySupport.getExpiredQueueMessageAdvisoryTopic()</li>
<li>AdvisorySupport.getNoTopicConsumersAdvisoryTopic()</li>
<li>AdvisorySupport.getNoQueueConsumersAdvisoryTopic()</li>
<li>AdvisorySupport.getDestinationAdvisoryTopic()</li>
<li>AdvisorySupport.getExpiredQueueMessageAdvisoryTopic()</li>
<li>AdvisorySupport.getExpiredTopicMessageAdvisoryTopic()</li>
<li>AdvisorySupport.getNoQueueConsumersAdvisoryTopic()</li>
<li>AdvisorySupport.getNoTopicConsumersAdvisoryTopic()</li>
</ul>
<p>// Version 5.2 on:</p>
<ul>
<li>AdvisorySupport.getSlowConsumerAdvisoryTopic()</li>
<li>AdvisorySupport.getFastProducerAdvisoryTopic()</li>
<li>AdvisorySupport.getMessageDiscardedAdvisoryTopic()</li>
<li>AdvisorySupport.getMessageDeliveredAdvisoryTopic()</li>
<li>AdvisorySupport.getMessageConsumedAdvisoryTopic()</li>
<li>AdvisorySupport.getMasterBrokerAdvisoryTopic()</li>
<li>AdvisorySupport.getFullAdvisoryTopic()</li>
</ul>
<p>Some helper classes to deal with advisory messages are available in the <a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/advisory/package-summary.html">advisories</a> package.</p>
</div>
</div>
</div>
</div>
<div class="row sitemap">
<div class="col-sm-12">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-3">
<div >
<img class="float-left" style="max-height: 100px" src="/assets/img/activemq_logo_white_vertical_small.png"/>
</div>
</div>
<div style="text-align: center; margin-bottom: 0px; margin-top: 30px; font-size: 65%" class="col-sm-6">
<p>Apache ActiveMQ, ActiveMQ, ActiveMQ Artemis, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright &copy; 2019, The Apache Software Foundation. Licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.</p>
</div>
<div class="col-sm-3">
<div >
<a href="https://www.apache.org"><img class="float-right" style="margin-top: 10px; max-height: 80px" src="/assets/img/apache-logo-small.png"/></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>