blob: 7557d43665e006b72f419390dec6b49a447bbbb0 [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>Apache Tomcat Support</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>Apache Tomcat Support</h1>
<div id="toc" class="toc2">
<div id="toctitle"><a href="index.html">User Manual for 2.33.0</a></div>
<ul class="sectlevel1">
<li><a href="#resource-context-client-configuration">1. Resource Context Client Configuration</a>
<ul class="sectlevel2">
<li><a href="#example-of-connection-factory">1.1. Example of Connection Factory</a></li>
<li><a href="#example-of-destination-queue-and-topic">1.2. Example of Destination (Queue and Topic)</a></li>
</ul>
</li>
<li><a href="#example-tomcat-app">2. Example Tomcat App</a></li>
</ul>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="resource-context-client-configuration"><a class="anchor" href="#resource-context-client-configuration"></a><a class="link" href="#resource-context-client-configuration">1. Resource Context Client Configuration</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Apache ActiveMQ Artemis provides support for configuring the client in the <code>context.xml</code> of the Tomcat container.</p>
</div>
<div class="paragraph">
<p>This is very similar to the way this is done in ActiveMQ "Classic" so anyone migrating should find this familiar.
Please note though the connection url and properties that can be set for ActiveMQ Artemis are different please see <a href="https://activemq.apache.org/artemis/migration/">Migration Documentation</a></p>
</div>
<div class="sect2">
<h3 id="example-of-connection-factory"><a class="anchor" href="#example-of-connection-factory"></a><a class="link" href="#example-of-connection-factory">1.1. Example of Connection Factory</a></h3>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt">&lt;Context&gt;</span>
...
<span class="nt">&lt;Resource</span> <span class="na">name=</span><span class="s">"jms/ConnectionFactory"</span> <span class="na">auth=</span><span class="s">"Container"</span> <span class="na">type=</span><span class="s">"org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory"</span> <span class="na">description=</span><span class="s">"JMS Connection Factory"</span>
<span class="na">factory=</span><span class="s">"org.apache.activemq.artemis.jndi.JNDIReferenceFactory"</span> <span class="na">brokerURL=</span><span class="s">"tcp://localhost:61616"</span> <span class="nt">/&gt;</span>
...
<span class="nt">&lt;/Context&gt;</span></code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="example-of-destination-queue-and-topic"><a class="anchor" href="#example-of-destination-queue-and-topic"></a><a class="link" href="#example-of-destination-queue-and-topic">1.2. Example of Destination (Queue and Topic)</a></h3>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt">&lt;Context&gt;</span>
...
<span class="nt">&lt;Resource</span> <span class="na">name=</span><span class="s">"jms/ExampleQueue"</span> <span class="na">auth=</span><span class="s">"Container"</span> <span class="na">type=</span><span class="s">"org.apache.activemq.artemis.jms.client.ActiveMQQueue"</span> <span class="na">description=</span><span class="s">"JMS Queue"</span>
<span class="na">factory=</span><span class="s">"org.apache.activemq.artemis.jndi.JNDIReferenceFactory"</span> <span class="na">address=</span><span class="s">"ExampleQueue"</span> <span class="nt">/&gt;</span>
...
<span class="nt">&lt;Resource</span> <span class="na">name=</span><span class="s">"jms/ExampleTopic"</span> <span class="na">auth=</span><span class="s">"Container"</span> <span class="na">type=</span><span class="s">"org.apache.activemq.artemis.jms.client.ActiveMQTopic"</span> <span class="na">description=</span><span class="s">"JMS Topic"</span>
<span class="na">factory=</span><span class="s">"org.apache.activemq.artemis.jndi.JNDIReferenceFactory"</span> <span class="na">address=</span><span class="s">"ExampleTopic"</span> <span class="nt">/&gt;</span>
...
<span class="nt">&lt;/Context&gt;</span></code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="example-tomcat-app"><a class="anchor" href="#example-tomcat-app"></a><a class="link" href="#example-tomcat-app">2. Example Tomcat App</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>A sample Tomcat app with the container context configured as an example can be seen here:</p>
</div>
<div class="paragraph">
<p>/examples/features/sub-modules/tomcat</p>
</div>
</div>
</div>
</div>
</body>
</html>