| |
| <!DOCTYPE HTML> |
| <html lang="" > |
| <head> |
| <title>Examples ยท ActiveMQ Artemis Documentation</title> |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
| <meta name="description" content=""> |
| <meta name="generator" content="GitBook 3.1.1"> |
| |
| |
| |
| |
| <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="wildcard-routing.html" /> |
| |
| |
| <link rel="prev" href="client-classpath.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="notice.html"> |
| |
| <a href="notice.html"> |
| |
| |
| Legal Notice |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.3" data-path="preface.html"> |
| |
| <a href="preface.html"> |
| |
| |
| Preface |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.4" data-path="project-info.html"> |
| |
| <a href="project-info.html"> |
| |
| |
| Project Info |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.5" data-path="messaging-concepts.html"> |
| |
| <a href="messaging-concepts.html"> |
| |
| |
| Messaging Concepts |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.6" data-path="architecture.html"> |
| |
| <a href="architecture.html"> |
| |
| |
| Architecture |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.7" data-path="using-server.html"> |
| |
| <a href="using-server.html"> |
| |
| |
| Using the Server |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.8" data-path="address-model.html"> |
| |
| <a href="address-model.html"> |
| |
| |
| Address Model |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.9" data-path="using-jms.html"> |
| |
| <a href="using-jms.html"> |
| |
| |
| Using JMS |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.10" data-path="using-core.html"> |
| |
| <a href="using-core.html"> |
| |
| |
| Using Core |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.11" data-path="using-AMQP.html"> |
| |
| <a href="using-AMQP.html"> |
| |
| |
| Using AMQP |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.12" data-path="jms-core-mapping.html"> |
| |
| <a href="jms-core-mapping.html"> |
| |
| |
| Mapping JMS Concepts to the Core API |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.13" data-path="client-classpath.html"> |
| |
| <a href="client-classpath.html"> |
| |
| |
| The Client Classpath |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter active" data-level="1.14" data-path="examples.html"> |
| |
| <a href="examples.html"> |
| |
| |
| Examples |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.15" data-path="wildcard-routing.html"> |
| |
| <a href="wildcard-routing.html"> |
| |
| |
| Routing Messages With Wild Cards |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.16" data-path="wildcard-syntax.html"> |
| |
| <a href="wildcard-syntax.html"> |
| |
| |
| Understanding the Apache ActiveMQ Artemis Wildcard Syntax |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.17" data-path="filter-expressions.html"> |
| |
| <a href="filter-expressions.html"> |
| |
| |
| Filter Expressions |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.18" data-path="persistence.html"> |
| |
| <a href="persistence.html"> |
| |
| |
| Persistence |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.19" data-path="configuring-transports.html"> |
| |
| <a href="configuring-transports.html"> |
| |
| |
| Configuring Transports |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.20" data-path="config-reload.html"> |
| |
| <a href="config-reload.html"> |
| |
| |
| Configuration Reload |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.21" data-path="connection-ttl.html"> |
| |
| <a href="connection-ttl.html"> |
| |
| |
| Detecting Dead Connections |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.22" data-path="slow-consumers.html"> |
| |
| <a href="slow-consumers.html"> |
| |
| |
| Detecting Slow Consumers |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.23" data-path="network-isolation.html"> |
| |
| <a href="network-isolation.html"> |
| |
| |
| Avoiding Network Isolation |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.24" data-path="transaction-config.html"> |
| |
| <a href="transaction-config.html"> |
| |
| |
| Resource Manager Configuration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.25" data-path="flow-control.html"> |
| |
| <a href="flow-control.html"> |
| |
| |
| Flow Control |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.26" data-path="send-guarantees.html"> |
| |
| <a href="send-guarantees.html"> |
| |
| |
| Guarantees of sends and commits |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.27" data-path="undelivered-messages.html"> |
| |
| <a href="undelivered-messages.html"> |
| |
| |
| Message Redelivery and Undelivered Messages |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.28" data-path="message-expiry.html"> |
| |
| <a href="message-expiry.html"> |
| |
| |
| Message Expiry |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.29" data-path="large-messages.html"> |
| |
| <a href="large-messages.html"> |
| |
| |
| Large Messages |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.30" data-path="paging.html"> |
| |
| <a href="paging.html"> |
| |
| |
| Paging |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.31" data-path="queue-attributes.html"> |
| |
| <a href="queue-attributes.html"> |
| |
| |
| Queue Attributes |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.32" data-path="scheduled-messages.html"> |
| |
| <a href="scheduled-messages.html"> |
| |
| |
| Scheduled Messages |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.33" data-path="last-value-queues.html"> |
| |
| <a href="last-value-queues.html"> |
| |
| |
| Last-Value Queues |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.34" data-path="message-grouping.html"> |
| |
| <a href="message-grouping.html"> |
| |
| |
| Message Grouping |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.35" data-path="pre-acknowledge.html"> |
| |
| <a href="pre-acknowledge.html"> |
| |
| |
| Extra Acknowledge Modes |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.36" data-path="management.html"> |
| |
| <a href="management.html"> |
| |
| |
| Management |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.37" data-path="security.html"> |
| |
| <a href="security.html"> |
| |
| |
| Security |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.38" data-path="broker-plugins.html"> |
| |
| <a href="broker-plugins.html"> |
| |
| |
| Broker Plugins |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.39" data-path="resource-limits.html"> |
| |
| <a href="resource-limits.html"> |
| |
| |
| Resource Limits |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.40" data-path="jms-bridge.html"> |
| |
| <a href="jms-bridge.html"> |
| |
| |
| The JMS Bridge |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.41" data-path="client-reconnection.html"> |
| |
| <a href="client-reconnection.html"> |
| |
| |
| Client Reconnection and Session Reattachment |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.42" data-path="diverts.html"> |
| |
| <a href="diverts.html"> |
| |
| |
| Diverting and Splitting Message Flows |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.43" data-path="core-bridges.html"> |
| |
| <a href="core-bridges.html"> |
| |
| |
| Core Bridges |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.44" data-path="duplicate-detection.html"> |
| |
| <a href="duplicate-detection.html"> |
| |
| |
| Duplicate Message Detection |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.45" data-path="clusters.html"> |
| |
| <a href="clusters.html"> |
| |
| |
| Clusters |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.46" data-path="ha.html"> |
| |
| <a href="ha.html"> |
| |
| |
| High Availability and Failover |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.47" data-path="graceful-shutdown.html"> |
| |
| <a href="graceful-shutdown.html"> |
| |
| |
| Graceful Server Shutdown |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.48" data-path="libaio.html"> |
| |
| <a href="libaio.html"> |
| |
| |
| Libaio Native Libraries |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.49" data-path="thread-pooling.html"> |
| |
| <a href="thread-pooling.html"> |
| |
| |
| Thread management |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.50" data-path="logging.html"> |
| |
| <a href="logging.html"> |
| |
| |
| Logging |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.51" data-path="rest.html"> |
| |
| <a href="rest.html"> |
| |
| |
| REST Interface |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.52" data-path="embedding-activemq.html"> |
| |
| <a href="embedding-activemq.html"> |
| |
| |
| Embedding Apache ActiveMQ Artemis |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.53" data-path="karaf.html"> |
| |
| <a href="karaf.html"> |
| |
| |
| Apache Karaf |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.54" data-path="spring-integration.html"> |
| |
| <a href="spring-integration.html"> |
| |
| |
| Spring Integration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.55" data-path="cdi-integration.html"> |
| |
| <a href="cdi-integration.html"> |
| |
| |
| CDI Integration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.56" data-path="intercepting-operations.html"> |
| |
| <a href="intercepting-operations.html"> |
| |
| |
| Intercepting Operations |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.57" data-path="protocols-interoperability.html"> |
| |
| <a href="protocols-interoperability.html"> |
| |
| |
| Protocols and Interoperability |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.58" data-path="tools.html"> |
| |
| <a href="tools.html"> |
| |
| |
| Tools |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.59" data-path="maven-plugin.html"> |
| |
| <a href="maven-plugin.html"> |
| |
| |
| Maven Plugin |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.60" data-path="unit-testing.html"> |
| |
| <a href="unit-testing.html"> |
| |
| |
| Unit Testing |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.61" data-path="perf-tuning.html"> |
| |
| <a href="perf-tuning.html"> |
| |
| |
| Troubleshooting and Performance Tuning |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.62" data-path="configuration-index.html"> |
| |
| <a href="configuration-index.html"> |
| |
| |
| Configuration Reference |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.63" data-path="updating-artemis.html"> |
| |
| <a href="updating-artemis.html"> |
| |
| |
| Updating Artemis |
| |
| </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="." >Examples</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="examples">Examples</h1> |
| <p>The Apache ActiveMQ Artemis distribution comes with over 90 run out-of-the-box examples demonstrating many of the features.</p> |
| <p>The examples are available in both the binary and source distribution under the <code>examples</code> directory. Examples are split |
| by the following source tree:</p> |
| <ul> |
| <li>features - Examples containing broker specific features.<ul> |
| <li>ha - examples showing failover and reconnection capabilities.</li> |
| <li>clustered - examples showing load balancing and distribution capabilities.</li> |
| <li>perf - examples allowing you to run a few performance tests on the server</li> |
| <li>sub-modules - examples of integrated external modules.</li> |
| </ul> |
| </li> |
| <li>protocols - Protocol specific examples<ul> |
| <li>openwire</li> |
| <li>mqtt</li> |
| <li>stomp</li> |
| <li>amqp</li> |
| </ul> |
| </li> |
| </ul> |
| <p>A set of Java EE examples are also provided which need WildFly installed to be able to run.</p> |
| <h1 id="running-the-examples">Running the Examples</h1> |
| <p>To run any example, simply <code>cd</code> into the appropriate example directory and type <code>mvn verify</code> or <code>mvn install</code> (For |
| details please read the readme.html in each example directory).</p> |
| <p>You can use the profile <code>-Pexamples</code> to run multiple examples under any example tree.</p> |
| <p>For each server, you will have a created server under <code>./target/server0</code> (some examples use more than one server).</p> |
| <p>You have the option to prevent the example from starting the server (e.g. if you want to start the server manually) by |
| simply specifying the <code>-PnoServer</code> profile, e.g.:</p> |
| <pre><code class="lang-sh"><span class="hljs-comment"># running an example without running the server</span> |
| mvn verify -PnoServer |
| </code></pre> |
| <p>Also under <code>./target</code> there will be a script repeating the commands to create each server. Here is the <code>create-server0.sh</code> |
| generated by the <code>Queue</code> example. This is useful to see exactly what command(s) are required to configure the server(s).</p> |
| <pre><code class="lang-sh"><span class="hljs-comment"># These are the commands used to create server0</span> |
| /myInstallDirectory/apache-artemis-1.1.0/bin/artemis create --allow-anonymous --silent --force --no-web --user guest --password guest --role guest --port-offset 0 --data ./data --allow-anonymous --no-autotune --verbose /myInstallDirectory/apache-artemis-1.1.0/examples/features/standard/queue/target/server0 |
| </code></pre> |
| <p>Several examples use UDP clustering which may not work in your environment by default. On linux the command would be:</p> |
| <pre><code class="lang-sh">route add -net 224.0.0.0 netmask 240.0.0.0 dev lo |
| </code></pre> |
| <p>This command should be run as root. This will redirect any traffic directed to <code>224.0.0.0</code> to the loopback interface. |
| On Mac OS X, the command is slightly different:</p> |
| <pre><code class="lang-sh">sudo route add 224.0.0.0 127.0.0.1 -netmask 240.0.0.0 |
| </code></pre> |
| <p>All the examples use the <a href="maven-plugin.html">Maven plugin</a>, which can be useful for running your test servers as well.</p> |
| <p>This is the common output when running an example. On this case taken from the <code>Queue</code> example:</p> |
| <pre><code class="lang-sh">[INFO] Scanning <span class="hljs-keyword">for</span> projects... |
| [INFO] |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] Building ActiveMQ Artemis JMS Queue Example 1.1.0 |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] |
| [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ queue --- |
| [INFO] |
| [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ queue --- |
| [INFO] |
| [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ queue --- |
| [INFO] Using <span class="hljs-string">'UTF-8'</span> encoding to copy filtered resources. |
| [INFO] Copying 1 resource |
| [INFO] Copying 3 resources |
| [INFO] |
| [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ queue --- |
| [INFO] Changes detected - recompiling the module! |
| [INFO] Compiling 1 <span class="hljs-built_in">source</span> file to /work/apache-artemis-1.1.0/examples/features/standard/queue/target/classes |
| [INFO] |
| [INFO] --- maven-checkstyle-plugin:2.16:check (default) @ queue --- |
| [INFO] |
| [INFO] --- apache-rat-plugin:0.11:check (default) @ queue --- |
| [INFO] RAT will not execute since it is configured to be skipped via system property <span class="hljs-string">'rat.skip'</span>. |
| [INFO] |
| [INFO] --- maven-resources-plugin:2.6:<span class="hljs-built_in">test</span>Resources (default-testResources) @ queue --- |
| [INFO] Using <span class="hljs-string">'UTF-8'</span> encoding to copy filtered resources. |
| [INFO] skip non existing resourceDirectory /work/apache-artemis-1.1.0/examples/features/standard/queue/src/<span class="hljs-built_in">test</span>/resources |
| [INFO] Copying 3 resources |
| [INFO] |
| [INFO] --- maven-compiler-plugin:3.1:<span class="hljs-built_in">test</span>Compile (default-testCompile) @ queue --- |
| [INFO] No sources to compile |
| [INFO] |
| [INFO] --- maven-surefire-plugin:2.18.1:<span class="hljs-built_in">test</span> (default-test) @ queue --- |
| [INFO] |
| [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ queue --- |
| [INFO] Building jar: /work/apache-artemis-1.1.0/examples/features/standard/queue/target/queue-1.1.0.jar |
| [INFO] |
| [INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ queue --- |
| [INFO] |
| [INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) > generate-sources @ queue >>> |
| [INFO] |
| [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ queue --- |
| [INFO] |
| [INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) < generate-sources @ queue <<< |
| [INFO] |
| [INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ queue --- |
| [INFO] Building jar: /work/apache-artemis-1.1.0/examples/features/standard/queue/target/queue-1.1.0-sources.jar |
| [INFO] |
| [INFO] >>> maven-source-plugin:2.2.1:jar (default) > generate-sources @ queue >>> |
| [INFO] |
| [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ queue --- |
| [INFO] |
| [INFO] <<< maven-source-plugin:2.2.1:jar (default) < generate-sources @ queue <<< |
| [INFO] |
| [INFO] --- maven-source-plugin:2.2.1:jar (default) @ queue --- |
| [INFO] |
| [INFO] --- artemis-maven-plugin:1.1.0:create (create) @ queue --- |
| [INFO] Local id: <span class="hljs-built_in">local</span> |
| url: file:///Users/apacheuser/.m2/repository/ |
| layout: default |
| snapshots: [enabled => <span class="hljs-literal">true</span>, update => always] |
| releases: [enabled => <span class="hljs-literal">true</span>, update => always] |
| |
| [INFO] Entries.size 2 |
| [INFO] ... key=project = MavenProject: org.apache.activemq.examples.broker:queue:1.1.0 @ /work/apache-artemis-1.1.0/examples/features/standard/queue/pom.xml |
| [INFO] ... key=pluginDescriptor = Component Descriptor: role: <span class="hljs-string">'org.apache.maven.plugin.Mojo'</span>, implementation: <span class="hljs-string">'org.apache.activemq.artemis.maven.ArtemisCLIPlugin'</span>, role hint: <span class="hljs-string">'org.apache.activemq:artemis-maven-plugin:1.1.0:cli'</span> |
| role: <span class="hljs-string">'org.apache.maven.plugin.Mojo'</span>, implementation: <span class="hljs-string">'org.apache.activemq.artemis.maven.ArtemisCreatePlugin'</span>, role hint: <span class="hljs-string">'org.apache.activemq:artemis-maven-plugin:1.1.0:create'</span> |
| role: <span class="hljs-string">'org.apache.maven.plugin.Mojo'</span>, implementation: <span class="hljs-string">'org.apache.activemq.artemis.maven.ArtemisClientPlugin'</span>, role hint: <span class="hljs-string">'org.apache.activemq:artemis-maven-plugin:1.1.0:runClient'</span> |
| --- |
| Executing org.apache.activemq.artemis.cli.commands.Create create --allow-anonymous --silent --force --no-web --user guest --password guest --role guest --port-offset 0 --data ./data --allow-anonymous --no-autotune --verbose /work/apache-artemis-1.1.0/examples/features/standard/queue/target/server0 |
| Home::/work/apache-artemis-1.1.0/examples/features/standard/queue/../../../.., Instance::. |
| Creating ActiveMQ Artemis instance at: /work/apache-artemis-1.1.0/examples/features/standard/queue/target/server0 |
| |
| You can now start the broker by executing: |
| |
| <span class="hljs-string">"/work/apache-artemis-1.1.0/examples/features/standard/queue/target/server0/bin/artemis"</span> run |
| |
| Or you can run the broker <span class="hljs-keyword">in</span> the background using: |
| |
| <span class="hljs-string">"/work/apache-artemis-1.1.0/examples/features/standard/queue/target/server0/bin/artemis-service"</span> start |
| |
| [INFO] <span class="hljs-comment">###################################################################################################</span> |
| [INFO] create-server0.sh created with commands to reproduce server0 |
| [INFO] under /work/apache-artemis-1.1.0/examples/features/standard/queue/target |
| [INFO] <span class="hljs-comment">###################################################################################################</span> |
| [INFO] |
| [INFO] --- artemis-maven-plugin:1.1.0:cli (start) @ queue --- |
| [INFO] awaiting server to start |
| [INFO] awaiting server to start |
| server-out: _ _ _ |
| server-out: / \ ____| |_ ___ __ __(_) _____ |
| server-out: / _ \| _ \ __|/ _ \ \/ | |/ __/ |
| server-out: / ___ \ | \/ |_/ __/ |\/| | |\___ \ |
| server-out: /_/ \_\| \__\____|_| |_|_|/___ / |
| server-out: Apache ActiveMQ Artemis 1.1.0 |
| server-out: |
| server-out: |
| server-out:17:30:25,091 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server |
| server-out:17:30:25,120 INFO [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=<span class="hljs-literal">false</span>,journalDirectory=./data/journal,bindingsDirectory=./data/bindings,largeMessagesDirectory=./data/large-messages,pagingDirectory=./data/paging) |
| server-out:17:30:25,152 INFO [org.apache.activemq.artemis.core.server] AMQ221013: Using NIO Journal |
| server-out:17:30:25,195 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support <span class="hljs-keyword">for</span>: CORE |
| server-out:17:30:25,199 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support <span class="hljs-keyword">for</span>: AMQP |
| server-out:17:30:25,209 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support <span class="hljs-keyword">for</span>: HORNETQ |
| server-out:17:30:25,211 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support <span class="hljs-keyword">for</span>: MQTT |
| server-out:17:30:25,214 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support <span class="hljs-keyword">for</span>: OPENWIRE |
| server-out:17:30:25,335 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support <span class="hljs-keyword">for</span>: STOMP |
| [INFO] awaiting server to start |
| server-out:17:30:25,781 INFO [org.apache.activemq.artemis.core.server] AMQ221003: trying to deploy queue jms.queue.DLQ |
| server-out:17:30:25,835 INFO [org.apache.activemq.artemis.core.server] AMQ221003: trying to deploy queue jms.queue.ExpiryQueue |
| server-out:17:30:25,933 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:61616 <span class="hljs-keyword">for</span> protocols [CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE] |
| server-out:17:30:25,936 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:5445 <span class="hljs-keyword">for</span> protocols [HORNETQ,STOMP] |
| server-out:17:30:25,939 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:5672 <span class="hljs-keyword">for</span> protocols [AMQP] |
| server-out:17:30:25,944 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:1883 <span class="hljs-keyword">for</span> protocols [MQTT] |
| server-out:17:30:25,948 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:61613 <span class="hljs-keyword">for</span> protocols [STOMP] |
| server-out:17:30:25,949 INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live |
| server-out:17:30:25,949 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.1.0 [nodeID=a855176b-50f0-11e5-937e-2fe9bb000966] |
| [INFO] Server started |
| [INFO] |
| [INFO] --- artemis-maven-plugin:1.1.0:runClient (runClient) @ queue --- |
| Sent message: This is a text message |
| Received message: This is a text message |
| [INFO] |
| [INFO] --- artemis-maven-plugin:1.1.0:cli (stop) @ queue --- |
| server-out:17:30:27,476 INFO [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 1.0.1-SNA |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] BUILD SUCCESS |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] Total time: 7.840 s |
| [INFO] Finished at: 2015-09-01T17:30:27-04:00 |
| [INFO] Final Memory: 42M/508M |
| [INFO] ------------------------------------------------------------------------ |
| </code></pre> |
| <h1 id="list">List</h1> |
| <p>This includes a preview list of a few examples that we distribute with Artemis. Please refer to the distribution for a more accurate list.</p> |
| <h2 id="applet">Applet</h2> |
| <p>This example shows you how to send and receive JMS messages from an Applet.</p> |
| <h2 id="application-layer-failover">Application-Layer Failover</h2> |
| <p>Apache ActiveMQ Artemis also supports Application-Layer failover, useful in the case |
| that replication is not enabled on the server side.</p> |
| <p>With Application-Layer failover, it's up to the application to register |
| a JMS <code>ExceptionListener</code> with Apache ActiveMQ Artemis which will be called by Apache ActiveMQ Artemis |
| in the event that connection failure is detected.</p> |
| <p>The code in the <code>ExceptionListener</code> then recreates the JMS connection, |
| session, etc on another node and the application can continue.</p> |
| <p>Application-layer failover is an alternative approach to High |
| Availability (HA). Application-layer failover differs from automatic |
| failover in that some client side coding is required in order to |
| implement this. Also, with Application-layer failover, since the old |
| session object dies and a new one is created, any uncommitted work in |
| the old session will be lost, and any unacknowledged messages might be |
| redelivered.</p> |
| <h2 id="core-bridge-example">Core Bridge Example</h2> |
| <p>The <code>bridge</code> example demonstrates a core bridge deployed on one server, |
| which consumes messages from a local queue and forwards them to an |
| address on a second server.</p> |
| <p>Core bridges are used to create message flows between any two Apache ActiveMQ Artemis |
| servers which are remotely separated. Core bridges are resilient and |
| will cope with temporary connection failure allowing them to be an ideal |
| choice for forwarding over unreliable connections, e.g. a WAN.</p> |
| <h2 id="browser">Browser</h2> |
| <p>The <code>browser</code> example shows you how to use a JMS <code>QueueBrowser</code> with |
| Apache ActiveMQ Artemis.</p> |
| <p>Queues are a standard part of JMS, please consult the JMS 2.0 |
| specification for full details.</p> |
| <p>A <code>QueueBrowser</code> is used to look at messages on the queue without |
| removing them. It can scan the entire content of a queue or only |
| messages matching a message selector.</p> |
| <h2 id="client-kickoff">Client Kickoff</h2> |
| <p>The <code>client-kickoff</code> example shows how to terminate client connections |
| given an IP address using the JMX management API.</p> |
| <h2 id="client-side-failover-listener">Client side failover listener</h2> |
| <p>The <code>client-side-failoverlistener</code> example shows how to register a |
| listener to monitor failover events</p> |
| <h2 id="client-side-load-balancing">Client-Side Load-Balancing</h2> |
| <p>The <code>client-side-load-balancing</code> example demonstrates how sessions |
| created from a single JMS <code>Connection</code> can be created to different nodes |
| of the cluster. In other words it demonstrates how Apache ActiveMQ Artemis does |
| client-side load-balancing of sessions across the cluster.</p> |
| <h2 id="clustered-durable-subscription">Clustered Durable Subscription</h2> |
| <p>This example demonstrates a clustered JMS durable subscription</p> |
| <h2 id="clustered-grouping">Clustered Grouping</h2> |
| <p>This is similar to the message grouping example except that it |
| demonstrates it working over a cluster. Messages sent to different nodes |
| with the same group id will be sent to the same node and the same |
| consumer.</p> |
| <h2 id="clustered-queue">Clustered Queue</h2> |
| <p>The <code>clustered-queue</code> example demonstrates a JMS queue deployed on two |
| different nodes. The two nodes are configured to form a cluster. We then |
| create a consumer for the queue on each node, and we create a producer |
| on only one of the nodes. We then send some messages via the producer, |
| and we verify that both consumers receive the sent messages in a |
| round-robin fashion.</p> |
| <h2 id="clustering-with-jgroups">Clustering with JGroups</h2> |
| <p>The <code>clustered-jgroups</code> example demonstrates how to form a two node |
| cluster using JGroups as its underlying topology discovery technique, |
| rather than the default UDP broadcasting. We then create a consumer for |
| the queue on each node, and we create a producer on only one of the |
| nodes. We then send some messages via the producer, and we verify that |
| both consumers receive the sent messages in a round-robin fashion.</p> |
| <h2 id="clustered-standalone">Clustered Standalone</h2> |
| <p>The <code>clustered-standalone</code> example demonstrates how to configure and |
| starts 3 cluster nodes on the same machine to form a cluster. A |
| subscriber for a JMS topic is created on each node, and we create a |
| producer on only one of the nodes. We then send some messages via the |
| producer, and we verify that the 3 subscribers receive all the sent |
| messages.</p> |
| <h2 id="clustered-static-discovery">Clustered Static Discovery</h2> |
| <p>This example demonstrates how to configure a cluster using a list of |
| connectors rather than UDP for discovery</p> |
| <h2 id="clustered-static-cluster-one-way">Clustered Static Cluster One Way</h2> |
| <p>This example demonstrates how to set up a cluster where cluster |
| connections are one way, i.e. server A -> Server B -> Server C</p> |
| <h2 id="clustered-topic">Clustered Topic</h2> |
| <p>The <code>clustered-topic</code> example demonstrates a JMS topic deployed on two |
| different nodes. The two nodes are configured to form a cluster. We then |
| create a subscriber on the topic on each node, and we create a producer |
| on only one of the nodes. We then send some messages via the producer, |
| and we verify that both subscribers receive all the sent messages.</p> |
| <h2 id="message-consumer-rate-limiting">Message Consumer Rate Limiting</h2> |
| <p>With Apache ActiveMQ Artemis you can specify a maximum consume rate at which a JMS |
| MessageConsumer will consume messages. This can be specified when |
| creating or deploying the connection factory.</p> |
| <p>If this value is specified then Apache ActiveMQ Artemis will ensure that messages are |
| never consumed at a rate higher than the specified rate. This is a form |
| of consumer throttling.</p> |
| <h2 id="dead-letter">Dead Letter</h2> |
| <p>The <code>dead-letter</code> example shows you how to define and deal with dead |
| letter messages. Messages can be delivered unsuccessfully (e.g. if the |
| transacted session used to consume them is rolled back).</p> |
| <p>Such a message goes back to the JMS destination ready to be redelivered. |
| However, this means it is possible for a message to be delivered again |
| and again without any success and remain in the destination, clogging |
| the system.</p> |
| <p>To prevent this, messaging systems define dead letter messages: after a |
| specified unsuccessful delivery attempts, the message is removed from |
| the destination and put instead in a dead letter destination where they |
| can be consumed for further investigation.</p> |
| <h2 id="delayed-redelivery">Delayed Redelivery</h2> |
| <p>The <code>delayed-redelivery</code> example demonstrates how Apache ActiveMQ Artemis can be |
| configured to provide a delayed redelivery in the case a message needs |
| to be redelivered.</p> |
| <p>Delaying redelivery can often be useful in the case that clients |
| regularly fail or roll-back. Without a delayed redelivery, the system |
| can get into a "thrashing" state, with delivery being attempted, the |
| client rolling back, and delivery being re-attempted in quick |
| succession, using up valuable CPU and network resources.</p> |
| <h2 id="divert">Divert</h2> |
| <p>Apache ActiveMQ Artemis diverts allow messages to be transparently "diverted" or copied |
| from one address to another with just some simple configuration defined |
| on the server side.</p> |
| <h2 id="durable-subscription">Durable Subscription</h2> |
| <p>The <code>durable-subscription</code> example shows you how to use a durable |
| subscription with Apache ActiveMQ Artemis. Durable subscriptions are a standard part of |
| JMS, please consult the JMS 1.1 specification for full details.</p> |
| <p>Unlike non-durable subscriptions, the key function of durable |
| subscriptions is that the messages contained in them persist longer than |
| the lifetime of the subscriber - i.e. they will accumulate messages sent |
| to the topic even if there is no active subscriber on them. They will |
| also survive server restarts or crashes. Note that for the messages to |
| be persisted, the messages sent to them must be marked as durable |
| messages.</p> |
| <h2 id="embedded">Embedded</h2> |
| <p>The <code>embedded</code> example shows how to embed JMS within your own code using |
| POJO instantiation and no config files.</p> |
| <h2 id="embedded-simple">Embedded Simple</h2> |
| <p>The <code>embedded</code> example shows how to embed JMS within your own code using |
| regular Apache ActiveMQ Artemis XML files.</p> |
| <h2 id="message-expiration">Message Expiration</h2> |
| <p>The <code>expiry</code> example shows you how to define and deal with message |
| expiration. Messages can be retained in the messaging system for a |
| limited period of time before being removed. JMS specification states |
| that clients should not receive messages that have been expired (but it |
| does not guarantee this will not happen).</p> |
| <p>Apache ActiveMQ Artemis can assign an expiry address to a given queue so that when |
| messages are expired, they are removed from the queue and sent to the |
| expiry address. These "expired" messages can later be consumed from the |
| expiry address for further inspection.</p> |
| <h2 id="apache-activemq-artemis-resource-adapter-example">Apache ActiveMQ Artemis Resource Adapter example</h2> |
| <p>This examples shows how to build the activemq resource adapters a rar |
| for deployment in other Application Server's</p> |
| <h2 id="http-transport">HTTP Transport</h2> |
| <p>The <code>http-transport</code> example shows you how to configure Apache ActiveMQ Artemis to use |
| the HTTP protocol as its transport layer.</p> |
| <h2 id="instantiate-jms-objects-directly">Instantiate JMS Objects Directly</h2> |
| <p>Usually, JMS Objects such as <code>ConnectionFactory</code>, <code>Queue</code> and <code>Topic</code> |
| instances are looked up from JNDI before being used by the client code. |
| This objects are called "administered objects" in JMS terminology.</p> |
| <p>However, in some cases a JNDI server may not be available or desired. To |
| come to the rescue Apache ActiveMQ Artemis also supports the direct instantiation of |
| these administered objects on the client side so you don't have to use |
| JNDI for JMS.</p> |
| <h2 id="interceptor">Interceptor</h2> |
| <p>Apache ActiveMQ Artemis allows an application to use an interceptor to hook into the |
| messaging system. Interceptors allow you to handle various message |
| events in Apache ActiveMQ Artemis.</p> |
| <h2 id="jaas">JAAS</h2> |
| <p>The <code>jaas</code> example shows you how to configure Apache ActiveMQ Artemis to use JAAS for |
| security. Apache ActiveMQ Artemis can leverage JAAS to delegate user authentication and |
| authorization to existing security infrastructure.</p> |
| <h2 id="jms-auto-closable">JMS Auto Closable</h2> |
| <p>The <code>jms-auto-closeable</code> example shows how JMS resources, such as |
| connections, sessions and consumers, in JMS 2 can be automatically |
| closed on error.</p> |
| <h2 id="jms-completion-listener">JMS Completion Listener</h2> |
| <p>The <code>jms-completion-listener</code> example shows how to send a message |
| asynchronously to Apache ActiveMQ Artemis and use a CompletionListener to be notified |
| of the Broker receiving it.</p> |
| <h2 id="jms-bridge">JMS Bridge</h2> |
| <p>The <code>jms-bridge</code> example shows how to setup a bridge between two |
| standalone Apache ActiveMQ Artemis servers.</p> |
| <h2 id="jms-context">JMS Context</h2> |
| <p>The <code>jms-context</code> example shows how to send and receive a message to a |
| JMS Queue using Apache ActiveMQ Artemis by using a JMS Context.</p> |
| <p>A JMSContext is part of JMS 2.0 and combines the JMS Connection and |
| Session Objects into a simple Interface.</p> |
| <h2 id="jms-shared-consumer">JMS Shared Consumer</h2> |
| <p>The <code>jms-shared-consumer</code> example shows you how can use shared consumers |
| to share a subscription on a topic. In JMS 1.1 this was not allowed and |
| so caused a scalability issue. In JMS 2 this restriction has been lifted |
| so you can share the load across different threads and connections.</p> |
| <h2 id="jmx-management">JMX Management</h2> |
| <p>The <code>jmx</code> example shows how to manage Apache ActiveMQ Artemis using JMX.</p> |
| <h2 id="large-message">Large Message</h2> |
| <p>The <code>large-message</code> example shows you how to send and receive very large |
| messages with Apache ActiveMQ Artemis. Apache ActiveMQ Artemis supports the sending and receiving of |
| huge messages, much larger than can fit in available RAM on the client |
| or server. Effectively the only limit to message size is the amount of |
| disk space you have on the server.</p> |
| <p>Large messages are persisted on the server so they can survive a server |
| restart. In other words Apache ActiveMQ Artemis doesn't just do a simple socket stream |
| from the sender to the consumer.</p> |
| <h2 id="last-value-queue">Last-Value Queue</h2> |
| <p>The <code>last-value-queue</code> example shows you how to define and deal with |
| last-value queues. Last-value queues are special queues which discard |
| any messages when a newer message with the same value for a well-defined |
| last-value property is put in the queue. In other words, a last-value |
| queue only retains the last value.</p> |
| <p>A typical example for last-value queue is for stock prices, where you |
| are only interested by the latest price for a particular stock.</p> |
| <h2 id="management">Management</h2> |
| <p>The <code>management</code> example shows how to manage Apache ActiveMQ Artemis using JMS Messages |
| to invoke management operations on the server.</p> |
| <h2 id="management-notification">Management Notification</h2> |
| <p>The <code>management-notification</code> example shows how to receive management |
| notifications from Apache ActiveMQ Artemis using JMS messages. Apache ActiveMQ Artemis servers emit |
| management notifications when events of interest occur (consumers are |
| created or closed, addresses are created or deleted, security |
| authentication fails, etc.).</p> |
| <h2 id="message-counter">Message Counter</h2> |
| <p>The <code>message-counters</code> example shows you how to use message counters to |
| obtain message information for a JMS queue.</p> |
| <h2 id="message-group">Message Group</h2> |
| <p>The <code>message-group</code> example shows you how to configure and use message |
| groups with Apache ActiveMQ Artemis. Message groups allow you to pin messages so they |
| are only consumed by a single consumer. Message groups are sets of |
| messages that has the following characteristics:</p> |
| <ul> |
| <li><p>Messages in a message group share the same group id, i.e. they have |
| same JMSXGroupID string property values</p> |
| </li> |
| <li><p>The consumer that receives the first message of a group will receive |
| all the messages that belongs to the group</p> |
| </li> |
| </ul> |
| <h2 id="message-group">Message Group</h2> |
| <p>The <code>message-group2</code> example shows you how to configure and use message |
| groups with Apache ActiveMQ Artemis via a connection factory.</p> |
| <h2 id="message-priority">Message Priority</h2> |
| <p>Message Priority can be used to influence the delivery order for |
| messages.</p> |
| <p>It can be retrieved by the message's standard header field 'JMSPriority' |
| as defined in JMS specification version 1.1.</p> |
| <p>The value is of type integer, ranging from 0 (the lowest) to 9 (the |
| highest). When messages are being delivered, their priorities will |
| effect their order of delivery. Messages of higher priorities will |
| likely be delivered before those of lower priorities.</p> |
| <p>Messages of equal priorities are delivered in the natural order of their |
| arrival at their destinations. Please consult the JMS 1.1 specification |
| for full details.</p> |
| <h2 id="multiple-failover">Multiple Failover</h2> |
| <p>This example demonstrates how to set up a live server with multiple |
| backups</p> |
| <h2 id="multiple-failover-failback">Multiple Failover Failback</h2> |
| <p>This example demonstrates how to set up a live server with multiple |
| backups but forcing failover back to the original live server</p> |
| <h2 id="no-consumer-buffering">No Consumer Buffering</h2> |
| <p>By default, Apache ActiveMQ Artemis consumers buffer messages from the server in a |
| client side buffer before you actually receive them on the client side. |
| This improves performance since otherwise every time you called |
| receive() or had processed the last message in a |
| <code>MessageListener onMessage()</code> method, the Apache ActiveMQ Artemis client would have to |
| go the server to request the next message, which would then get sent to |
| the client side, if one was available.</p> |
| <p>This would involve a network round trip for every message and reduce |
| performance. Therefore, by default, Apache ActiveMQ Artemis pre-fetches messages into a |
| buffer on each consumer.</p> |
| <p>In some case buffering is not desirable, and Apache ActiveMQ Artemis allows it to be |
| switched off. This example demonstrates that.</p> |
| <h2 id="non-transaction-failover-with-server-data-replication">Non-Transaction Failover With Server Data Replication</h2> |
| <p>The <code>non-transaction-failover</code> example demonstrates two servers coupled |
| as a live-backup pair for high availability (HA), and a client using a |
| <em>non-transacted</em> JMS session failing over from live to backup when the |
| live server is crashed.</p> |
| <p>Apache ActiveMQ Artemis implements failover of client connections between live and |
| backup servers. This is implemented by the replication of state between |
| live and backup nodes. When replication is configured and a live node |
| crashes, the client connections can carry and continue to send and |
| consume messages. When non-transacted sessions are used, once and only |
| once message delivery is not guaranteed and it is possible that some |
| messages will be lost or delivered twice.</p> |
| <h2 id="openwire">OpenWire</h2> |
| <p>The <code>Openwire</code> example shows how to configure an Apache ActiveMQ Artemis server to |
| communicate with an Apache ActiveMQ Artemis JMS client that uses open-wire protocol.</p> |
| <p>You will find the queue example for open wire, and the chat example.</p> |
| <h2 id="paging">Paging</h2> |
| <p>The <code>paging</code> example shows how Apache ActiveMQ Artemis can support huge queues even |
| when the server is running in limited RAM. It does this by transparently |
| <em>paging</em> messages to disk, and <em>depaging</em> them when they are required.</p> |
| <h2 id="pre-acknowledge">Pre-Acknowledge</h2> |
| <p>Standard JMS supports three acknowledgement modes:<code>AUTO_ACKNOWLEDGE</code>, <code>CLIENT_ACKNOWLEDGE</code>, and |
| <code>DUPS_OK_ACKNOWLEDGE</code>. For a full description on these modes please |
| consult the JMS specification, or any JMS tutorial.</p> |
| <p>All of these standard modes involve sending acknowledgements from the |
| client to the server. However in some cases, you really don't mind |
| losing messages in event of failure, so it would make sense to |
| acknowledge the message on the server before delivering it to the |
| client. This example demonstrates how Apache ActiveMQ Artemis allows this with an extra |
| acknowledgement mode.</p> |
| <h2 id="message-producer-rate-limiting">Message Producer Rate Limiting</h2> |
| <p>The <code>producer-rte-limit</code> example demonstrates how, with Apache ActiveMQ Artemis, you |
| can specify a maximum send rate at which a JMS message producer will |
| send messages.</p> |
| <h2 id="queue">Queue</h2> |
| <p>A simple example demonstrating a JMS queue.</p> |
| <h2 id="message-redistribution">Message Redistribution</h2> |
| <p>The <code>queue-message-redistribution</code> example demonstrates message |
| redistribution between queues with the same name deployed in different |
| nodes of a cluster.</p> |
| <h2 id="queue-requestor">Queue Requestor</h2> |
| <p>A simple example demonstrating a JMS queue requestor.</p> |
| <h2 id="queue-with-message-selector">Queue with Message Selector</h2> |
| <p>The <code>queue-selector</code> example shows you how to selectively consume |
| messages using message selectors with queue consumers.</p> |
| <h2 id="reattach-node-example">Reattach Node example</h2> |
| <p>The <code>Reattach Node</code> example shows how a client can try to reconnect to |
| the same server instead of failing the connection immediately and |
| notifying any user ExceptionListener objects. Apache ActiveMQ Artemis can be configured |
| to automatically retry the connection, and reattach to the server when |
| it becomes available again across the network.</p> |
| <h2 id="replicated-failback-example">Replicated Failback example</h2> |
| <p>An example showing how failback works when using replication, In this |
| example a live server will replicate all its Journal to a backup server |
| as it updates it. When the live server crashes the backup takes over |
| from the live server and the client reconnects and carries on from where |
| it left off.</p> |
| <h2 id="replicated-failback-static-example">Replicated Failback static example</h2> |
| <p>An example showing how failback works when using replication, but this |
| time with static connectors</p> |
| <h2 id="replicated-multiple-failover-example">Replicated multiple failover example</h2> |
| <p>An example showing how to configure multiple backups when using |
| replication</p> |
| <h2 id="replicated-failover-transaction-example">Replicated Failover transaction example</h2> |
| <p>An example showing how failover works with a transaction when using |
| replication</p> |
| <h2 id="request-reply-example">Request-Reply example</h2> |
| <p>A simple example showing the JMS request-response pattern.</p> |
| <h2 id="scheduled-message">Scheduled Message</h2> |
| <p>The <code>scheduled-message</code> example shows you how to send a scheduled |
| message to a JMS Queue with Apache ActiveMQ Artemis. Scheduled messages won't get |
| delivered until a specified time in the future.</p> |
| <h2 id="security">Security</h2> |
| <p>The <code>security</code> example shows you how configure and use role based queue |
| security with Apache ActiveMQ Artemis.</p> |
| <h2 id="send-acknowledgements">Send Acknowledgements</h2> |
| <p>The <code>send-acknowledgements</code> example shows you how to use Apache ActiveMQ Artemis's |
| advanced <em>asynchronous send acknowledgements</em> feature to obtain |
| acknowledgement from the server that sends have been received and |
| processed in a separate stream to the sent messages.</p> |
| <h2 id="spring-integration">Spring Integration</h2> |
| <p>This example shows how to use embedded JMS using Apache ActiveMQ Artemis's Spring |
| integration.</p> |
| <h2 id="ssl-transport">SSL Transport</h2> |
| <p>The <code>ssl-enabled</code> shows you how to configure SSL with Apache ActiveMQ Artemis to send |
| and receive message.</p> |
| <h2 id="static-message-selector">Static Message Selector</h2> |
| <p>The <code>static-selector</code> example shows you how to configure an Apache ActiveMQ Artemis core |
| queue with static message selectors (filters).</p> |
| <h2 id="static-message-selector-using-jms">Static Message Selector Using JMS</h2> |
| <p>The <code>static-selector-jms</code> example shows you how to configure an Apache ActiveMQ Artemis |
| queue with static message selectors (filters) using JMS.</p> |
| <h2 id="stomp">Stomp</h2> |
| <p>The <code>stomp</code> example shows you how to configure an Apache ActiveMQ Artemis server to send |
| and receive Stomp messages.</p> |
| <h2 id="stomp11">Stomp1.1</h2> |
| <p>The <code>stomp</code> example shows you how to configure an Apache ActiveMQ Artemis server to send |
| and receive Stomp messages via a Stomp 1.1 connection.</p> |
| <h2 id="stomp12">Stomp1.2</h2> |
| <p>The <code>stomp</code> example shows you how to configure an Apache ActiveMQ Artemis server to send |
| and receive Stomp messages via a Stomp 1.2 connection.</p> |
| <h2 id="stomp-over-web-sockets">Stomp Over Web Sockets</h2> |
| <p>The <code>stomp-websockets</code> example shows you how to configure an Apache ActiveMQ Artemis |
| server to send and receive Stomp messages directly from Web browsers |
| (provided they support Web Sockets).</p> |
| <h2 id="symmetric-cluster">Symmetric Cluster</h2> |
| <p>The <code>symmetric-cluster</code> example demonstrates a symmetric cluster set-up |
| with Apache ActiveMQ Artemis.</p> |
| <p>Apache ActiveMQ Artemis has extremely flexible clustering which allows you to set-up |
| servers in many different topologies. The most common topology that |
| you'll perhaps be familiar with if you are used to application server |
| clustering is a symmetric cluster.</p> |
| <p>With a symmetric cluster, the cluster is homogeneous, i.e. each node is |
| configured the same as every other node, and every node is connected to |
| every other node in the cluster.</p> |
| <h2 id="temporary-queue">Temporary Queue</h2> |
| <p>A simple example demonstrating how to use a JMS temporary queue.</p> |
| <h2 id="topic">Topic</h2> |
| <p>A simple example demonstrating a JMS topic.</p> |
| <h2 id="topic-hierarchy">Topic Hierarchy</h2> |
| <p>Apache ActiveMQ Artemis supports topic hierarchies. With a topic hierarchy you can |
| register a subscriber with a wild-card and that subscriber will receive |
| any messages sent to an address that matches the wild card.</p> |
| <h2 id="topic-selector-1">Topic Selector 1</h2> |
| <p>The <code>topic-selector-example1</code> example shows you how to send message to a |
| JMS Topic, and subscribe them using selectors with Apache ActiveMQ Artemis.</p> |
| <h2 id="topic-selector-2">Topic Selector 2</h2> |
| <p>The <code>topic-selector-example2</code> example shows you how to selectively |
| consume messages using message selectors with topic consumers.</p> |
| <h2 id="transaction-failover">Transaction Failover</h2> |
| <p>The <code>transaction-failover</code> example demonstrates two servers coupled as a |
| live-backup pair for high availability (HA), and a client using a |
| transacted JMS session failing over from live to backup when the live |
| server is crashed.</p> |
| <p>Apache ActiveMQ Artemis implements failover of client connections between live and |
| backup servers. This is implemented by the sharing of a journal between |
| the servers. When a live node crashes, the client connections can carry |
| and continue to send and consume messages. When transacted sessions are |
| used, once and only once message delivery is guaranteed.</p> |
| <h2 id="failover-without-transactions">Failover Without Transactions</h2> |
| <p>The <code>stop-server-failover</code> example demonstrates failover of the JMS |
| connection from one node to another when the live server crashes using a |
| JMS non-transacted session.</p> |
| <h2 id="transactional-session">Transactional Session</h2> |
| <p>The <code>transactional</code> example shows you how to use a transactional Session |
| with Apache ActiveMQ Artemis.</p> |
| <h2 id="xa-heuristic">XA Heuristic</h2> |
| <p>The <code>xa-heuristic</code> example shows you how to make an XA heuristic |
| decision through Apache ActiveMQ Artemis Management Interface. A heuristic decision is |
| a unilateral decision to commit or rollback an XA transaction branch |
| after it has been prepared.</p> |
| <h2 id="xa-receive">XA Receive</h2> |
| <p>The <code>xa-receive</code> example shows you how message receiving behaves in an |
| XA transaction in Apache ActiveMQ Artemis.</p> |
| <h2 id="xa-send">XA Send</h2> |
| <p>The <code>xa-send</code> example shows you how message sending behaves in an XA |
| transaction in Apache ActiveMQ Artemis.</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="client-classpath.html" class="navigation navigation-prev " aria-label="Previous page: The Client Classpath"> |
| <i class="fa fa-angle-left"></i> |
| </a> |
| |
| |
| <a href="wildcard-routing.html" class="navigation navigation-next " aria-label="Next page: Routing Messages With Wild Cards"> |
| <i class="fa fa-angle-right"></i> |
| </a> |
| |
| |
| |
| </div> |
| |
| <script> |
| var gitbook = gitbook || []; |
| gitbook.push(function() { |
| gitbook.page.hasChanged({"page":{"title":"Examples","level":"1.14","depth":1,"next":{"title":"Routing Messages With Wild Cards","level":"1.15","depth":1,"path":"wildcard-routing.md","ref":"wildcard-routing.md","articles":[]},"previous":{"title":"The Client Classpath","level":"1.13","depth":1,"path":"client-classpath.md","ref":"client-classpath.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},"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 User Guide and Reference Documentation"},"file":{"path":"examples.md","mtime":"2017-08-02T23:09:18.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2017-08-04T18:56:43.143Z"},"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> |
| |