blob: 5583283e58f79cfc7d095a492f20fd92b7532cb9 [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="/js/fontawesome-all.min.js" integrity="sha384-rOA1PnstxnOBLzCLMcre8ybwbTmemjzdNlILg8O7z1lUkLXozs4DHonlDtnE7fpc"></script>
<script src="/js/jquery.slim.min.js" integrity="sha384-5AkRS45j4ukf+JbWAfHL8P4onPA9p0KwwP7pUdjSQA3ss9edbJUJc/XcYAiheSSz"></script>
<script src="/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"></script>
<script src="/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"></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="/news">News</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<span class="caret"></span></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 Classic</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">Community<span class="caret"></span></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">Contact Us</a></li>
<li class="nav-item"><a class="dropdown-item" href="/contributing">Contribute</a></li>
<li class="nav-item"><a class="dropdown-item" href="/issues">Report Issues</a></li>
<li class="nav-item"><a class="dropdown-item" href="/support">Get Support</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"><img src="/assets/img/feather.png" style="height:20px">Apache<span class="caret"></span></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">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="https://whimsy.apache.org/board/minutes/ActiveMQ.html">Board Reports</a></li>
<li class="nav-item"><a class="dropdown-item" href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy Policy</a></li>
</ul>
</div>
</div>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="content">
<div class="page-title-classic">
<div class="container">
<h1>Advisory Message</h1>
</div>
</div>
<div class="container" >
<div class="row" style="margin-top: 30px">
<div class="col-12 classic">
<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 Classic 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="language-plaintext highlighter-rouge">ActiveMQ.Advisory.</code>.</p>
<p>Every Advisory has the message <strong>type</strong> <code class="language-plaintext 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="language-plaintext highlighter-rouge">originBrokerId</code></td>
<td><code class="language-plaintext 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="language-plaintext highlighter-rouge">originBrokerName</code></td>
<td><code class="language-plaintext 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="language-plaintext highlighter-rouge">originBrokerURL</code></td>
<td><code class="language-plaintext 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="language-plaintext 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="language-plaintext highlighter-rouge">ActiveMQMessage</code>. Specific <code class="language-plaintext highlighter-rouge">DataStructure</code> objects, e.g.,. <code class="language-plaintext highlighter-rouge">ConsumerInfo</code>, <code class="language-plaintext highlighter-rouge">ProducerInfo</code>, <code class="language-plaintext highlighter-rouge">ConnectionInfo</code> can be retrieved using <code class="language-plaintext highlighter-rouge">ActiveMQMessage.getDataStructure()</code>.</p>
<p>For example:</p>
<div class="language-plaintext 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="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Connection</code></td>
<td>Connection start &amp; stop messages.</td>
<td> </td>
<td><code class="language-plaintext highlighter-rouge">ConnectionInfo</code><code class="language-plaintext highlighter-rouge">RemoveInfo</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Producer.Queue</code></td>
<td>Producer start &amp; stop messages on a Queue.</td>
<td><code class="language-plaintext highlighter-rouge">String='producerCount'</code> - the number of producers</td>
<td><code class="language-plaintext highlighter-rouge">ProducerInfo</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Producer.Topic</code></td>
<td>Producer start &amp; stop messages on a Topic.</td>
<td><code class="language-plaintext highlighter-rouge">String='producerCount'</code> - the number of producers</td>
<td><code class="language-plaintext highlighter-rouge">ProducerInfo</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Consumer.Queue</code></td>
<td>Consumer start &amp; stop messages on a Queue.</td>
<td><code class="language-plaintext highlighter-rouge">String='consumerCount'</code> - the number of Consumers</td>
<td><code class="language-plaintext highlighter-rouge">ConnectionInfo</code><code class="language-plaintext highlighter-rouge">RemoveInfo</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Consumer.Topic</code></td>
<td>Consumer start &amp; stop messages on a Topic.</td>
<td><code class="language-plaintext highlighter-rouge">String='consumerCount'</code> - the number of Consumers</td>
<td><code class="language-plaintext highlighter-rouge">ConnectionInfo</code><code class="language-plaintext highlighter-rouge">RemoveInfo</code></td>
</tr>
</tbody>
</table>
<p>Note that the consumer start/stop advisory messages also have a <code class="language-plaintext 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="language-plaintext 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="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Queue</code></td>
<td>Queue create &amp; destroy.</td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">DestinationInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Topic</code></td>
<td>Topic create &amp; destroy.</td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">DestinationInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.TempQueue</code></td>
<td>Temporary Queue create &amp; destroy.</td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">DestinationInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.TempTopic</code></td>
<td>Temporary Topic create &amp; destroy.</td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">DestinationInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Expired.Queue</code></td>
<td>Expired messages on a Queue.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the expired id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Expired.Topic</code></td>
<td>Expired messages on a Topic.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the expired id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext highlighter-rouge">none</code></td>
</tr>
<tr>
<td><code class="language-plaintext 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="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">sendAdvisoryIfNoConsumers</code></td>
</tr>
<tr>
<td><code class="language-plaintext 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="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">sendAdvisoryIfNoConsumers</code></td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>Tip</strong></p>
<p><code class="language-plaintext 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="language-plaintext highlighter-rouge">ActiveMQ.Advisory.SlowConsumer.Queue</code></td>
<td>Slow Queue Consumer.</td>
<td><code class="language-plaintext highlighter-rouge">String='consumerId'</code> - the consumer id</td>
<td><code class="language-plaintext highlighter-rouge">ConsumerInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForSlowConsumers</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.SlowConsumer.Topic</code></td>
<td>Slow Topic Consumer.</td>
<td><code class="language-plaintext highlighter-rouge">String='consumerId'</code> - the consumer id</td>
<td><code class="language-plaintext highlighter-rouge">ConsumerInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForSlowConsumers</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.FastProducer.Queue</code></td>
<td>Fast Queue producer.</td>
<td><code class="language-plaintext highlighter-rouge">String='producerId'</code> - the producer id</td>
<td><code class="language-plaintext highlighter-rouge">ProducerInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForFastProducers</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.FastProducer.Topic</code></td>
<td>Fast Topic producer.</td>
<td><code class="language-plaintext highlighter-rouge">String='consumerId'</code>’ - the producer id</td>
<td><code class="language-plaintext highlighter-rouge">ProducerInfo</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForFastProducers</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageDiscarded.Queue</code></td>
<td>Message discarded.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the discarded id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForDiscardingMessages</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageDiscarded.Topic</code></td>
<td>Message discarded.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the discarded id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForDiscardingMessages</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageDelivered.Queue</code></td>
<td>Message delivered to the broker.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForDelivery</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageDelivered.Topic</code></td>
<td>Message delivered to the broker.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForDelivery</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageConsumed.Queue</code></td>
<td>Message consumed by a client.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForConsumed</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageConsumed.Topic</code></td>
<td>Message consumed by a client.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryForConsumed</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.FULL</code></td>
<td>A Usage resource is at its limit.</td>
<td><code class="language-plaintext highlighter-rouge">String='usageName'</code> - the name of Usage resource</td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">false</code></td>
<td><code class="language-plaintext highlighter-rouge">advisoryWhenFull</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MasterBroker</code></td>
<td>A broker is now the master in a master/slave configuration.</td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">null</code></td>
<td><code class="language-plaintext highlighter-rouge">true</code></td>
<td><code class="language-plaintext 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="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageDLQd.Queue</code></td>
<td>Message sent to DLQ.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td>Always on</td>
<td><code class="language-plaintext highlighter-rouge">advisoryForConsumed</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.MessageDLQd.Topic</code></td>
<td>Message sent to DLQ.</td>
<td><code class="language-plaintext highlighter-rouge">String='orignalMessageId'</code> - the delivered id</td>
<td><code class="language-plaintext highlighter-rouge">Message</code></td>
<td>Always on</td>
<td><code class="language-plaintext highlighter-rouge">advisoryForConsumed</code></td>
</tr>
</tbody>
</table>
<h3 id="network-bridge-advisories">Network bridge advisories</h3>
<p>Starting with ActiveMQ Classic 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="language-plaintext highlighter-rouge">ActiveMQ.Advisory.NetworkBridge</code></td>
<td>Network bridge being stopped or started.</td>
<td><code class="language-plaintext highlighter-rouge">Boolean="started"</code> - <code class="language-plaintext highlighter-rouge">true</code> if bridge is started, <code class="language-plaintext highlighter-rouge">false</code> if it is stopped. <code class="language-plaintext highlighter-rouge">Boolean="createdByDuplex"</code> - <code class="language-plaintext highlighter-rouge">true</code> if the bridge is created by remote network connector.</td>
<td><code class="language-plaintext 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="language-plaintext highlighter-rouge">PolicyEntry</code> in the ActiveMQ Classic Broker Configuration, e.g., to enable a message consumed advisory you can configure the following:</p>
<div class="language-plaintext 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="language-plaintext 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="language-plaintext 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="language-plaintext 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="language-plaintext highlighter-rouge">ActiveMQConnectionFactory</code> (because a subscription to an advisory topic will auto create it) via the <code class="language-plaintext highlighter-rouge">brokerUrl</code>:</p>
<div class="language-plaintext 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="language-plaintext highlighter-rouge">watchTopicAdvisories</code> attribute on the <code class="language-plaintext highlighter-rouge">ActiveMQConnectionFactory</code>.</p>
<div class="language-plaintext 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="language-plaintext 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="language-plaintext highlighter-rouge">FOO.BAR</code> you could subscribe to <code class="language-plaintext highlighter-rouge">ActiveMQ.Advisory.Expired.Topic.FOO.BAR</code>. To subscribe to all messages of a certain kind of advisory just append <code class="language-plaintext 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="language-plaintext 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><a href="https://www.apache.org/foundation/marks/list/">Apache, ActiveMQ, Apache ActiveMQ</a>, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright &copy; 2024, 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>