blob: f7d804455fc6f76be6ece49b747c46137020edbd [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.18">
<link rel="icon" type="image/png" href="images/favicon.png">
<title>OpenWire</title>
<link rel="stylesheet" href="css/asciidoctor.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/rouge-github.css">
</head>
<body class="book toc2 toc-left">
<div id="header">
<h1>OpenWire</h1>
<div id="toc" class="toc2">
<div id="toctitle"><a href="index.html">User Manual for 2.32.0</a></div>
<ul class="sectlevel1">
<li><a href="#connection-monitoring">1. Connection Monitoring</a></li>
<li><a href="#disableenable-advisories">2. Disable/Enable Advisories</a></li>
<li><a href="#openwire-destination-cache">3. OpenWire Destination Cache</a></li>
<li><a href="#virtual-topic-consumer-destination-translation">4. Virtual Topic Consumer Destination Translation</a>
<ul class="sectlevel2">
<li><a href="#selectoraware">4.1. selectorAware</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Apache ActiveMQ Artemis supports the <a href="http://activemq.apache.org/openwire.html">OpenWire</a> protocol so that an Apache ActiveMQ "Classic" JMS client can talk directly to an Apache ActiveMQ Artemis server.
By default there is an <code>acceptor</code> configured to accept OpenWire connections on port <code>61616</code>.</p>
</div>
<div class="paragraph">
<p>See the general <a href="protocols-interoperability.html#protocols-and-interoperability">Protocols and Interoperability</a> chapter for details on configuring an <code>acceptor</code> for OpenWire.</p>
</div>
<div class="paragraph">
<p>Refer to the OpenWire <a href="examples.html">examples</a> for a look at this functionality in action.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="connection-monitoring"><a class="anchor" href="#connection-monitoring"></a><a class="link" href="#connection-monitoring">1. Connection Monitoring</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>OpenWire has a few parameters to control how each connection is monitored, they are:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">maxInactivityDuration</dt>
<dd>
<p>It specifies the time (milliseconds) after which the connection is closed by the broker if no data was received.
Default value is 30000.</p>
</dd>
<dt class="hdlist1">maxInactivityDurationInitalDelay</dt>
<dd>
<p>It specifies the maximum delay (milliseconds) before inactivity monitoring is started on the connection.
It can be useful if a broker is under load with many connections being created concurrently.
Default value is 10000.</p>
</dd>
<dt class="hdlist1">useInactivityMonitor</dt>
<dd>
<p>A value of false disables the InactivityMonitor completely and connections will never time out.
By default it is enabled.
On broker side you don&#8217;t neet set this.
Instead you can set the connection-ttl to -1.</p>
</dd>
<dt class="hdlist1">useKeepAlive</dt>
<dd>
<p>Indicates whether to send a KeepAliveInfo on an idle connection to prevent it from timing out.
Enabled by default.
Disabling the keep alive will still make connections time out if no data was received on the connection for the specified amount of time.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Note at the beginning the InactivityMonitor negotiates the appropriate <code>maxInactivityDuration</code> and <code>maxInactivityDurationInitalDelay</code>.
The shortest duration is taken for the connection.</p>
</div>
<div class="paragraph">
<p>Fore more details please see <a href="http://activemq.apache.org/activemq-inactivitymonitor.html">ActiveMQ InactivityMonitor</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="disableenable-advisories"><a class="anchor" href="#disableenable-advisories"></a><a class="link" href="#disableenable-advisories">2. Disable/Enable Advisories</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>By default, advisory topics (<a href="http://activemq.apache.org/advisory-message.html">ActiveMQ Advisory</a>) are created in order to send certain type of advisory messages to listening clients.
As a result, advisory addresses and queues will be displayed on the management console, along with user deployed addresses and queues.
This sometimes cause confusion because the advisory objects are internally managed without user being aware of them.
In addition, users may not want the advisory topics at all (they cause extra resources and performance penalty) and it is convenient to disable them at all from the broker side.</p>
</div>
<div class="paragraph">
<p>The protocol provides two parameters to control advisory behaviors on the broker side.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">supportAdvisory</dt>
<dd>
<p>Indicates whether the broker supports advisory messages.
If the value is true, advisory addresses/queues will be created.
If the value is false, no advisory addresses/queues are created.
Default value is <code>true</code>.</p>
</dd>
<dt class="hdlist1">suppressInternalManagementObjects</dt>
<dd>
<p>Indicates whether advisory addresses/queues, if any, will be registered to management service (e.g. JMX registry).
If set to true, no advisory addresses/queues will be registered.
If set to false, those are registered and will be displayed on the management console.
Default value is <code>true</code>.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>The two parameters are configured on an OpenWire <code>acceptor</code>, e.g.:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt">&lt;acceptor</span> <span class="na">name=</span><span class="s">"artemis"</span><span class="nt">&gt;</span>tcp://localhost:61616?protocols=OPENWIRE;supportAdvisory=true;suppressInternalManagementObjects=false<span class="nt">&lt;/acceptor&gt;</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="openwire-destination-cache"><a class="anchor" href="#openwire-destination-cache"></a><a class="link" href="#openwire-destination-cache">3. OpenWire Destination Cache</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>For improved performance of the broker we keep a cache of recently used destinations, so that when new messages are dispatched to them, we do not have to do a lookup every time.
By default, this cache holds up to <code>16</code> destinations.
If additional destinations are added they will overwrite older records.
If you are dealing with a large amount of queues you might want to increase this value, which is done via configuration option: <code>openWireDestinationCacheSize</code> set on the OpenWire <code>acceptor</code> like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt">&lt;acceptor</span> <span class="na">name=</span><span class="s">"artemis"</span><span class="nt">&gt;</span>tcp://localhost:61616?protocols=OPENWIRE;openWireDestinationCacheSize=64<span class="nt">&lt;/acceptor&gt;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>This cache has to be set to a power of 2, i.e.: <code>2</code>, <code>16</code>, <code>128</code> and so on.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="virtual-topic-consumer-destination-translation"><a class="anchor" href="#virtual-topic-consumer-destination-translation"></a><a class="link" href="#virtual-topic-consumer-destination-translation">4. Virtual Topic Consumer Destination Translation</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>For existing OpenWire consumers of virtual topic destinations it is possible to configure a mapping function that will translate the virtual topic consumer destination into a FQQN address.
This address will then represents the consumer as a multicast binding to an address representing the virtual topic.</p>
</div>
<div class="paragraph">
<p>The configuration string list property <code>virtualTopicConsumerWildcards</code> has parts separated by a <code>;</code>.
The first is the classic style destination filter that identifies the destination as belonging to a virtual topic.
The second identifies the number of <code>paths</code> that identify the consumer queue such that it can be parsed from the destination.
Any subsequent parts are additional configuration parameters for that mapping.</p>
</div>
<div class="paragraph">
<p>For example, the default virtual topic with consumer prefix of <code>Consumer.<strong>.</code>, would require a <code>virtualTopicConsumerWildcards</code> filter of <code>Consumer.</strong>.&gt;;2</code>.
As a url parameter this transforms to <code>Consumer.*.%3E%3B2</code> when the url significant characters <code>&gt;;</code> are escaped with their hex code points.
In an <code>acceptor</code> url it would be:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt">&lt;acceptor</span> <span class="na">name=</span><span class="s">"artemis"</span><span class="nt">&gt;</span>tcp://localhost:61616?protocols=OPENWIRE;virtualTopicConsumerWildcards=Consumer.*.%3E%3B2<span class="nt">&lt;/acceptor&gt;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>This will translate <code>Consumer.A.VirtualTopic.Orders</code> into a FQQN of <code>VirtualTopic.Orders::Consumer.A.VirtualTopic.Orders</code> using the int component <code>2</code> of the configuration to identify the consumer queue as the first two paths of the destination.
<code>virtualTopicConsumerWildcards</code> is multi valued using a <code>,</code> separator.</p>
</div>
<div class="sect2">
<h3 id="selectoraware"><a class="anchor" href="#selectoraware"></a><a class="link" href="#selectoraware">4.1. selectorAware</a></h3>
<div class="paragraph">
<p>The mappings support an optional parameter, <code>selectorAware</code> which when true, transfers any selector information from the OpenWire consumer into a queue filter of any auto-created subscription queue.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
the selector/filter is persisted with the queue binding in the normal way, such that it works independent of connected consumers.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Please see Virtual Topic Mapping example contained in the OpenWire <a href="examples.html#examples">examples</a>.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>