You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by bu...@apache.org on 2016/09/16 22:22:18 UTC

svn commit: r997544 - in /websites/production/activemq/content: broker-camel-component.html cache/main.pageCache consumer-priority.html delete-inactive-destinations.html

Author: buildbot
Date: Fri Sep 16 22:22:18 2016
New Revision: 997544

Log:
Production update by buildbot for activemq

Modified:
    websites/production/activemq/content/broker-camel-component.html
    websites/production/activemq/content/cache/main.pageCache
    websites/production/activemq/content/consumer-priority.html
    websites/production/activemq/content/delete-inactive-destinations.html

Modified: websites/production/activemq/content/broker-camel-component.html
==============================================================================
--- websites/production/activemq/content/broker-camel-component.html (original)
+++ websites/production/activemq/content/broker-camel-component.html Fri Sep 16 22:22:18 2016
@@ -35,7 +35,7 @@
           <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' /> 
       <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' /> 
       <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script> 
-              <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script> 
+              <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushXml.js' type='text/javascript'></script> 
          
       <script type="text/javascript"> 
         SyntaxHighlighter.defaults['toolbar'] = false; 
@@ -81,8 +81,8 @@
   <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="BrokerCamelComponent-BrokerCamelComponent">Broker Camel Component</h2><p><strong>Available as of AcitveMQ 5.9</strong></p><p>Embedding Apache Camel inside the ActiveMQ broker provides great flexibility for extending the message broker with the integration power of Camel. Apache Camel routes also benefit in that you can avoid the serialization and network costs of connecting to ActiveMQ remotely - if you use the <a shape="rect" class="external-link" href="http://camel.apache.org/activemq.html">activemq component</a>.</p><p>If however, you want to change the behaviour of messages flowing through the ActiveMQ message broker itself you will be limited to the shipped set of ActiveMQ Broker<a shape="rect" class="external-link" href="http://activemq.apache.org/interceptors.html">Interceptors</a>- or develop your own<a shape="rect" class="external-link" href="http://activemq.apache.org/developing-plugins.html">Broker plugin</a> and then introduc
 e that as a jar on to the class path for the ActiveMQ broker.</p><p>The <strong>broker</strong> camel component makes this even easier - which intercepts messages as they move through the broker itself, allowing them to be modified and manipulated before they are persisted to the message store or delivered to end consumers.</p><p><a shape="rect" class="external-link" href="http://activemq.apache.org/how-should-i-package-applications-using-camel-and-activemq.html">You can include a camel.xml file into your ActiveMQ broker config</a> and then if you want to take all messages sent to a Topic and publish them to a Queue, changing their priority along the way - you can do something like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">&lt;route id="setPriority"&gt;
+<div class="wiki-content maincontent"><h2 id="BrokerCamelComponent-BrokerCamelComponent">Broker Camel Component</h2><p><strong>Available as of ActiveMQ 5.9</strong></p><p>Embedding Apache Camel inside the ActiveMQ broker provides great flexibility for extending the message broker with the integration power of Camel. Apache Camel routes also benefit in that you can avoid the serialization and network costs of connecting to ActiveMQ remotely - if you use the <a shape="rect" class="external-link" href="http://camel.apache.org/activemq.html">activemq component</a>.</p><p>If however, you want to change the behavior of messages flowing through the ActiveMQ message broker itself you will be limited to the shipped set of ActiveMQ broker <a shape="rect" class="external-link" href="http://activemq.apache.org/interceptors.html">Interceptors</a> - or develop your own <a shape="rect" class="external-link" href="http://activemq.apache.org/developing-plugins.html">Broker plugin</a> and then introd
 uce that as a jar on to the class path for the ActiveMQ broker. The&#160;<strong><code>broker</code></strong> Camel component makes this even easier. It intercepts messages as they move through the broker itself, allowing them to be modified and manipulated before they are persisted to the message store or delivered to end consumers.</p><p>For example <a shape="rect" class="external-link" href="http://activemq.apache.org/how-should-i-package-applications-using-camel-and-activemq.html">by defining a CamelContext to run inside the broker's JVM </a>the&#160;<strong><code>broker</code></strong> component can intercept all messages published to a Topic, say, and publish them to a Queue instead, changing their priority along the way:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;route id="setPriority"&gt;
    &lt;from uri="broker:topic:test.broker.&gt;"/&gt;
       &lt;setHeader headerName="JMSPriority"&gt;
          &lt;constant&gt;9&lt;/constant&gt;
@@ -90,30 +90,31 @@
    &lt;to uri="broker:queue:test.broker.component.queue"/&gt;
 &lt;/route&gt;
 </pre>
-</div></div><p>A few things worth noting:</p><ul><li>A broker component only adds an intercept into the broker if its started - so the broker component will not add any overhead to the running broker until its used - and then the overhead will be trivial.</li><li>You intercept messages using the broker component when they have been received by the broker - but before they are processed (persisted or routed to a destination).</li><li>The in message on the CamelExchange is a Camel Message, but also a JMS Message (messages routed through ActiveMQ from Stomp/MQTT/AMQP etc. are always translated into JMS messages).</li><li>You can <a shape="rect" class="external-link" href="http://activemq.apache.org/wildcards.html">wildcards</a> on a destination to intercept messages from destinations matching the wildcard.</li><li>After the intercept, you have to explicitly send the message back to the broker component - this allows you to either drop select messages (by not sending) - or, like in the 
 above case - re-route the message to a different destination.</li><li>There is one deliberate caveat though, &#160;you can only send messages to a broker component that have been intercepted - i.e. &#160;routing a Camel message from another Component (e.g. File) would result in an error.</li></ul><p>There are some extra classes that have been added to the activemq-broker package - to enable views of the running broker without using JMX - and to support the use of the broker component:<br clear="none"> <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/5.9.0/apidocs/org/apache/activemq/broker/view/MessageBrokerView.html">MessageBrokerView</a> - which provides methods to retrieve statistics on a the broker, and from the MessageBrokerView - you can retrieve a <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/5.9.0/apidocs/org/apache/activemq/broker/view/BrokerDestinationView.html">BrokerDestinationView</a> for a particular destinatio
 n. This means you can add flexible routing inside the broker by doing something &#160;like the following - to route messages when a destination's queue depth reaches a certain limit:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">&lt;camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring"&gt;
-    &lt;route id="routeAboveQueueLimitTest"&gt;
-        &lt;from uri="broker:queue:test.broker.queue"/&gt;
-        &lt;choice&gt;
-            &lt;when&gt;
-                &lt;spel&gt;#{@destinationView.queueSize &gt;= 100}&lt;/spel&gt;
-                &lt;to uri="broker:queue:test.broker.processLater"/&gt;
-            &lt;/when&gt;
-            &lt;otherwise&gt;
-                &lt;to uri="broker:queue:test.broker.queue"/&gt;
-            &lt;/otherwise&gt;
-        &lt;/choice&gt;
-        &lt;/route&gt;
+</div></div><p>Notes:</p><ul><li>A broker component only adds an intercept into the broker if its started - so the broker component will not add any overhead to the running broker until its used - and then the overhead will be trivial.</li><li>Messages are intercepted by the broker component when they have been received by the broker - but before they are processed (persisted or routed to a destination).</li><li>The&#160;<strong><code>IN</code></strong> message on the Exchange is a <strong><code>CamelMessage</code></strong>, but also a JMS Message (messages routed through ActiveMQ from STOMP/MQTT/AMQP etc. are always translated into JMS messages).</li><li>W<a shape="rect" class="external-link" href="http://activemq.apache.org/wildcards.html">ildcards</a> can be used on a destination to intercept messages from destinations matching the wildcard.</li><li>After the intercept, you have to explicitly send the message back to the broker component - this allows you to either drop select me
 ssages (by not sending) - or, like in the above case - re-route the message to a different destination.<br clear="none"><br clear="none"></li></ul><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body">There is one deliberate caveat though, only intercepted messages can be sent to a&#160;<strong><code>broker</code></strong> component. For example, routing a Camel message from another Component e.g. <strong><code>file</code></strong>, will result in an error.</div></div><p>Extra classes that have been added to the&#160;<strong><code>activemq-broker</code></strong> package to support the&#160;<strong><code>broker</code></strong> component. They allow the state of the running broker to be interrogated without using JMX. These classes are:</p><ul><li><a shape="rect" class="external-link" href="http://activemq.apache.org/
 maven/5.9.0/apidocs/org/apache/activemq/broker/view/MessageBrokerView.html">MessageBrokerView</a> - provides methods to retrieve statistics on a the broker</li><li>From the MessageBrokerView - you can retrieve a <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/5.9.0/apidocs/org/apache/activemq/broker/view/BrokerDestinationView.html">BrokerDestinationView</a> for a particular destination.</li></ul><h3 id="BrokerCamelComponent-Example">Example</h3><p>How to route messages when a destination's queue depth has reached a certain limit:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring"&gt;
+  &lt;route id="routeAboveQueueLimitTest"&gt;
+    &lt;from uri="broker:queue:test.broker.queue"/&gt;
+    &lt;choice&gt;
+      &lt;when&gt;
+        &lt;spel&gt;#{@destinationView.queueSize &gt;= 100}&lt;/spel&gt;
+        &lt;to uri="broker:queue:test.broker.processLater"/&gt;
+      &lt;/when&gt;
+      &lt;otherwise&gt;
+        &lt;to uri="broker:queue:test.broker.queue"/&gt;
+      &lt;/otherwise&gt;
+    &lt;/choice&gt;
+  &lt;/route&gt;
+&lt;/camelContext&gt;
 
-    &lt;/camelContext&gt;
-    &lt;bean id="brokerView" class="org.apache.activemq.broker.view.MessageBrokerView"&gt;
-        &lt;constructor-arg value="testBroker"/&gt;
-    &lt;/bean&gt;
-    &lt;bean id="destinationView" factory-bean="brokerView" factory-method="getDestinationView"&gt;
-        &lt;constructor-arg value="test.broker.component.route"/&gt;
-    &lt;/bean&gt;
+&lt;bean id="brokerView" class="org.apache.activemq.broker.view.MessageBrokerView"&gt;
+  &lt;constructor-arg value="testBroker"/&gt;
+&lt;/bean&gt;
+
+&lt;bean id="destinationView" factory-bean="brokerView" factory-method="getDestinationView"&gt;
+  &lt;constructor-arg value="test.broker.component.route"/&gt;
+&lt;/bean&gt;
 </pre>
-</div></div><p>This is using the Camel Message Router pattern - note the use of Spring expression language <em>spel</em> in the <strong>when</strong> clause.</p></div>
+</div></div><p>This is using the Camel Message Router pattern. Note the use of the Spring expression language&#160;<strong><code>spel</code></strong> in the&#160;<strong><code>when</code></strong> clause.</p><p>&#160;</p></div>
         </td>
         <td valign="top">
           <div class="navigation">

Modified: websites/production/activemq/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/activemq/content/consumer-priority.html
==============================================================================
--- websites/production/activemq/content/consumer-priority.html (original)
+++ websites/production/activemq/content/consumer-priority.html Fri Sep 16 22:22:18 2016
@@ -81,26 +81,11 @@
   <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h3 id="ConsumerPriority-Background">Background</h3>
-
-<p>As well as having a pluggable dispatch policy (e.g. round robin etc), we now support consumer priorities.</p>
-
-<p>This allows us to weight consumers to optimise network hops. For example, you typically want a broker to send messages to regular JMS consumers rather than to other brokers; there's no need to make unnecessary broker-to-broker hops if there are available consumers.</p>
-
-<h3 id="ConsumerPriority-Example">Example</h3>
-
-<p>The priority for a consumer is set using <a shape="rect" href="destination-options.html">Destination Options</a> as follows:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
-queue = new ActiveMQQueue("TEST.QUEUE?consumer.priority=10");
+<div class="wiki-content maincontent"><h3 id="ConsumerPriority-Background">Background</h3><p>As well as having a pluggable dispatch policy e.g. round robin, ActiveMQ also supports consumer priorities. This allows us to weight consumers to optimize network hops. For example, you typically want a broker to send messages to regular JMS consumers rather than to other brokers; there's no need to make unnecessary broker-to-broker hops if there are available consumers.</p><h3 id="ConsumerPriority-Example">Example</h3><p>The priority for a consumer is set using <a shape="rect" href="destination-options.html">Destination Options</a> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">queue = new ActiveMQQueue("TEST.QUEUE?consumer.priority=10");
 consumer = session.createConsumer(queue);
 </pre>
-</div></div>
-
-<p>The range for assigning priority numbers is from 0 to 127, with 127 being the highest priority and 0 being the default priority.<br clear="none">
-The way it works is that the broker will simply order any queue consumers according to their priorities and send messages to the highest priority consumers first. <br clear="none">
-Once a particular consumer has its prefetch buffer filled up, the broker will begin to dispatch messages to consumers of lower priorities. </p></div>
+</div></div><p>The range of priority values is: <strong><code>0</code></strong> to <strong><code>127</code></strong>. The highest priority is <strong><code>127</code></strong>. The default priority is <strong><code>0</code></strong>.</p><p>The broker orders a queue's consumers according to their priorities, dispatching messages to the highest priority consumers first. Once a particular consumer's prefetch buffer is full the broker will start dispatching messages to the consumer with the next lowest priority whose prefetch buffer is not full.</p></div>
         </td>
         <td valign="top">
           <div class="navigation">

Modified: websites/production/activemq/content/delete-inactive-destinations.html
==============================================================================
--- websites/production/activemq/content/delete-inactive-destinations.html (original)
+++ websites/production/activemq/content/delete-inactive-destinations.html Fri Sep 16 22:22:18 2016
@@ -36,6 +36,7 @@
       <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' /> 
       <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script> 
               <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script> 
+              <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushXml.js' type='text/javascript'></script> 
          
       <script type="text/javascript"> 
         SyntaxHighlighter.defaults['toolbar'] = false; 
@@ -81,35 +82,21 @@
   <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><p>Sometimes you might want to delete destinations that are inactive for a period of time. Since ActiveMQ version <strong>5.4.0</strong>, it's possible to do that using destination policy entries and broker attribute schedulePeriodForDestinationPurge &gt; 0.</p>
+<div class="wiki-content maincontent"><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Inactive Destination</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">An 'inactive' destination is one that has had no messages pending and no consumers connected for some configured period of time.</div></div><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">By default the broker does <em>not</em> check for inactive destinations. This as governed by the default values for the following options: <strong><code>schedulePeriodForDestinationPurge="0"</code></strong> and&#160;<strong><code>gcInactiveDestinations="false"</code></strong>.</div></div><p>However, the broker can be confi
 gured to purge inactive destinations. To do so requires using specially configured destination policy entries in combination with the broker attribute: <strong><code>schedulePeriodForDestinationPurge &gt; 0</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000"&gt;
 
-<p>For example a configuration like</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
-  &lt;broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000"&gt;
-
-    &lt;destinationPolicy&gt;
-       &lt;policyMap&gt;
-          &lt;policyEntries&gt;
-             &lt;policyEntry queue="&gt;" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/&gt;
-          &lt;/policyEntries&gt;
-       &lt;/policyMap&gt;
-    &lt;/destinationPolicy&gt;
-        
-  &lt;/broker&gt;
-</pre>
-</div></div>
-
-<p>will check for inactive destination every 10 seconds (<code>schedulePeriodForDestinationPurge</code> option, default value is 0). And it will delete all queues (<code>gcInactiveDestinations</code> option, false by default) if they are empty for 30 seconds (<code>inactiveTimoutBeforeGC</code> option, default is 1 minute).</p>
-
-<p>When the destination is removed, you can see messages like</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+  &lt;destinationPolicy&gt;
+     &lt;policyMap&gt;
+        &lt;policyEntries&gt;
+           &lt;policyEntry queue="&gt;" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/&gt;
+        &lt;/policyEntries&gt;
+     &lt;/policyMap&gt;
+  &lt;/destinationPolicy&gt;
+      
+&lt;/broker&gt;</pre>
+</div></div><p>In this example the broker will check for inactive destinations every&#160;<strong><code>10</code></strong> seconds, as determined by <strong><code>schedulePeriodForDestinationPurge="10000"</code></strong>. When a destination purge is triggered the broker will delete any queue that has been empty for longer than <strong><code>inactiveTimoutBeforeGC="30000"</code></strong> milliseconds (default: <strong><code>60000</code></strong> milliseconds) and for which <strong><code>gcInactiveDestinations="true"</code></strong> is set on its corresponding destination policy entry.</p><p>When a destination is removed the broker will log a message like:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">INFO  Queue                          - TEST.QUEUE Inactive for longer than 30000 ms - removing ...</pre>
-</div></div>
-
-<p>in the log file.</p></div>
+</div></div><p>&#160;</p><p>&#160;</p></div>
         </td>
         <td valign="top">
           <div class="navigation">