blob: 62222de0bc862a0b54afa38c18af629bca2925ae [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Destinations ยท ActiveMQ Artemis Documentation</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="authentication.html" />
<link rel="prev" href="connectors.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="./">
<a href="./">
Introduction
</a>
</li>
<li class="chapter " data-level="1.2" data-path="configuration.html">
<a href="configuration.html">
Configuration
</a>
</li>
<li class="chapter " data-level="1.3" data-path="connectors.html">
<a href="connectors.html">
Connectors
</a>
</li>
<li class="chapter active" data-level="1.4" data-path="destinations.html">
<a href="destinations.html">
Destinations
</a>
</li>
<li class="chapter " data-level="1.5" data-path="authentication.html">
<a href="authentication.html">
Authentication
</a>
</li>
<li class="chapter " data-level="1.6" data-path="authorization.html">
<a href="authorization.html">
Authorization
</a>
</li>
<li class="chapter " data-level="1.7" data-path="ssl.html">
<a href="ssl.html">
SSL
</a>
</li>
<li class="chapter " data-level="1.8" data-path="notice.html">
<a href="notice.html">
Legal Notice
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >Destinations</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="destinations">Destinations</h1>
<p>We already talked about addressing differences between ActiveMQ and Artemis in the <a href="./">introduction</a>. Now let&apos;s dig into the details and see how to configure JMS queues and topics. It&apos;s important to note here that both brokers are configured by default to <em>auto-create</em> destinations requested by clients, which is preferred behavior for many use cases. This is configured using authorization security policies, so we will cover this topic in the later sections of this manual. For now, let&apos;s see how you can predefine JMS queues and topics in both brokers.</p>
<p>In ActiveMQ, destinations are pre-defined in the <code>&lt;destinations&gt;</code> section of the <code>conf/activemq.xml</code> configuration file.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">destinations</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">queue</span> <span class="hljs-attr">physicalName</span>=<span class="hljs-string">&quot;my-queue&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">topic</span> <span class="hljs-attr">physicalName</span>=<span class="hljs-string">&quot;my-topic&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">destinations</span>&gt;</span>
</code></pre>
<p>Things looks a bit different in Artemis. We already explained that queues are <code>anycast</code> addresses and topics are <code>muticast</code> ones. We&apos;re not gonna go deep into the address settings details here and you&apos;re advised to look at the user manual for that. Let&apos;s just see what we need to do in order to replicate ActiveMQ configuration. </p>
<p>Addresses are defined in <code>&lt;addresses&gt;</code> section of the <code>etc/broker.xml</code> configuration file. So the corresponding Artemis configuration for the ActiveMQ example above, looks like this:</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">addresses</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">address</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;my-queue&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">anycast</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">queue</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;my-queue&quot;</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">anycast</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">address</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">address</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;my-topic&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">multicast</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">multicast</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">address</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">adresses</span>&gt;</span>
</code></pre>
<p>After this step we have our destinations ready in the new broker.</p>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="connectors.html" class="navigation navigation-prev " aria-label="Previous page: Connectors">
<i class="fa fa-angle-left"></i>
</a>
<a href="authentication.html" class="navigation navigation-next " aria-label="Next page: Authentication">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Destinations","level":"1.4","depth":1,"next":{"title":"Authentication","level":"1.5","depth":1,"path":"authentication.md","ref":"authentication.md","articles":[]},"previous":{"title":"Connectors","level":"1.3","depth":1,"path":"connectors.md","ref":"connectors.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"apache/activemq-artemis","theme":"default","githubHost":"https://github.com/","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ActiveMQ Artemis Documentation","links":{"home":"http://activemq.apache.org/","issues":"http://activemq.apache.org/","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis Migration Guide"},"file":{"path":"destinations.md","mtime":"2017-03-10T10:03:20.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-10T13:48:00.771Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>