blob: 0c033abd0ea8767af54537779b022e7de7c8a6b0 [file]
<!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.23">
<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">
<script>
document.addEventListener("DOMContentLoaded", function() {
const pathSegments = window.location.pathname.split('/');
if (window.location.hostname == "artemis.apache.org" && pathSegments[pathSegments.length - 2] != "latest") {
var message = document.createElement("div");
message.style.margin = "20px";
message.style.textAlign = "center";
message.style.backgroundColor = "#FFFFE0";
message.textContent = "Please be aware that this documentation is out of date. ";
var link = document.createElement("a");
link.href = "../../latest";
link.textContent = "Here is the latest documentation.";
message.appendChild(link);
document.body.insertBefore(message, document.body.firstChild);
}
});
</script>
</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.50.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>A Artemis client can be configured 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 so anyone migrating should find this familiar.
Please note, the connection url and properties are different please see <a href="https://artemis.apache.org/components/artemis/migration-documentation/">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>