| |
| <!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="versions.html"> |
| |
| <a href="versions.html"> |
| |
| |
| Versions |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.6" data-path="messaging-concepts.html"> |
| |
| <a href="messaging-concepts.html"> |
| |
| |
| Messaging Concepts |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.7" data-path="architecture.html"> |
| |
| <a href="architecture.html"> |
| |
| |
| Architecture |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.8" data-path="using-server.html"> |
| |
| <a href="using-server.html"> |
| |
| |
| Using the Server |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.9" data-path="upgrading.html"> |
| |
| <a href="upgrading.html"> |
| |
| |
| Upgrading |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.10" data-path="address-model.html"> |
| |
| <a href="address-model.html"> |
| |
| |
| Address Model |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.11" data-path="protocols-interoperability.html"> |
| |
| <a href="protocols-interoperability.html"> |
| |
| |
| Protocols and Interoperability |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.12" data-path="amqp.html"> |
| |
| <a href="amqp.html"> |
| |
| |
| AMQP |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.13" data-path="mqtt.html"> |
| |
| <a href="mqtt.html"> |
| |
| |
| MQTT |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.14" data-path="stomp.html"> |
| |
| <a href="stomp.html"> |
| |
| |
| STOMP |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.15" data-path="openwire.html"> |
| |
| <a href="openwire.html"> |
| |
| |
| OpenWire |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.16" data-path="core.html"> |
| |
| <a href="core.html"> |
| |
| |
| Core |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.17" 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.18" data-path="using-jms.html"> |
| |
| <a href="using-jms.html"> |
| |
| |
| Using JMS |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.19" data-path="client-classpath.html"> |
| |
| <a href="client-classpath.html"> |
| |
| |
| The Client Classpath |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter active" data-level="1.20" data-path="examples.html"> |
| |
| <a href="examples.html"> |
| |
| |
| Examples |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.21" data-path="wildcard-routing.html"> |
| |
| <a href="wildcard-routing.html"> |
| |
| |
| Routing Messages With Wild Cards |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.22" data-path="wildcard-syntax.html"> |
| |
| <a href="wildcard-syntax.html"> |
| |
| |
| Wildcard Syntax |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.23" data-path="filter-expressions.html"> |
| |
| <a href="filter-expressions.html"> |
| |
| |
| Filter Expressions |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.24" data-path="persistence.html"> |
| |
| <a href="persistence.html"> |
| |
| |
| Persistence |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.25" data-path="configuring-transports.html"> |
| |
| <a href="configuring-transports.html"> |
| |
| |
| Configuring Transports |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.26" data-path="config-reload.html"> |
| |
| <a href="config-reload.html"> |
| |
| |
| Configuration Reload |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.27" data-path="connection-ttl.html"> |
| |
| <a href="connection-ttl.html"> |
| |
| |
| Detecting Dead Connections |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.28" data-path="slow-consumers.html"> |
| |
| <a href="slow-consumers.html"> |
| |
| |
| Detecting Slow Consumers |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.29" data-path="network-isolation.html"> |
| |
| <a href="network-isolation.html"> |
| |
| |
| Avoiding Network Isolation |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.30" data-path="critical-analysis.html"> |
| |
| <a href="critical-analysis.html"> |
| |
| |
| Detecting Broker Issues (Critical Analysis) |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.31" data-path="transaction-config.html"> |
| |
| <a href="transaction-config.html"> |
| |
| |
| Resource Manager Configuration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.32" data-path="flow-control.html"> |
| |
| <a href="flow-control.html"> |
| |
| |
| Flow Control |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.33" data-path="send-guarantees.html"> |
| |
| <a href="send-guarantees.html"> |
| |
| |
| Guarantees of sends and commits |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.34" data-path="undelivered-messages.html"> |
| |
| <a href="undelivered-messages.html"> |
| |
| |
| Message Redelivery and Undelivered Messages |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.35" data-path="message-expiry.html"> |
| |
| <a href="message-expiry.html"> |
| |
| |
| Message Expiry |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.36" data-path="large-messages.html"> |
| |
| <a href="large-messages.html"> |
| |
| |
| Large Messages |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.37" data-path="paging.html"> |
| |
| <a href="paging.html"> |
| |
| |
| Paging |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.38" data-path="scheduled-messages.html"> |
| |
| <a href="scheduled-messages.html"> |
| |
| |
| Scheduled Messages |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.39" data-path="last-value-queues.html"> |
| |
| <a href="last-value-queues.html"> |
| |
| |
| Last-Value Queues |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.40" data-path="ring-queues.html"> |
| |
| <a href="ring-queues.html"> |
| |
| |
| Ring Queues |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.41" data-path="retroactive-addresses.html"> |
| |
| <a href="retroactive-addresses.html"> |
| |
| |
| Retroactive Addresses |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.42" data-path="exclusive-queues.html"> |
| |
| <a href="exclusive-queues.html"> |
| |
| |
| Exclusive Queues |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.43" data-path="message-grouping.html"> |
| |
| <a href="message-grouping.html"> |
| |
| |
| Message Grouping |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.44" data-path="consumer-priority.html"> |
| |
| <a href="consumer-priority.html"> |
| |
| |
| Consumer Priority |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.45" data-path="pre-acknowledge.html"> |
| |
| <a href="pre-acknowledge.html"> |
| |
| |
| Extra Acknowledge Modes |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.46" data-path="management.html"> |
| |
| <a href="management.html"> |
| |
| |
| Management |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.47" data-path="management-console.html"> |
| |
| <a href="management-console.html"> |
| |
| |
| Management Console |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.48" data-path="metrics.html"> |
| |
| <a href="metrics.html"> |
| |
| |
| Metrics |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.49" data-path="security.html"> |
| |
| <a href="security.html"> |
| |
| |
| Security |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.50" data-path="masking-passwords.html"> |
| |
| <a href="masking-passwords.html"> |
| |
| |
| Masking Passwords |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.51" data-path="broker-plugins.html"> |
| |
| <a href="broker-plugins.html"> |
| |
| |
| Broker Plugins |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.52" data-path="resource-limits.html"> |
| |
| <a href="resource-limits.html"> |
| |
| |
| Resource Limits |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.53" data-path="jms-bridge.html"> |
| |
| <a href="jms-bridge.html"> |
| |
| |
| The JMS Bridge |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.54" data-path="client-reconnection.html"> |
| |
| <a href="client-reconnection.html"> |
| |
| |
| Client Reconnection and Session Reattachment |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.55" data-path="diverts.html"> |
| |
| <a href="diverts.html"> |
| |
| |
| Diverting and Splitting Message Flows |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.56" data-path="core-bridges.html"> |
| |
| <a href="core-bridges.html"> |
| |
| |
| Core Bridges |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.57" data-path="transformers.html"> |
| |
| <a href="transformers.html"> |
| |
| |
| Transformers |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.58" data-path="duplicate-detection.html"> |
| |
| <a href="duplicate-detection.html"> |
| |
| |
| Duplicate Message Detection |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.59" data-path="clusters.html"> |
| |
| <a href="clusters.html"> |
| |
| |
| Clusters |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.60" data-path="federation.html"> |
| |
| <a href="federation.html"> |
| |
| |
| Federation |
| |
| </a> |
| |
| |
| |
| <ul class="articles"> |
| |
| |
| <li class="chapter " data-level="1.60.1" data-path="federation-address.html"> |
| |
| <a href="federation-address.html"> |
| |
| |
| Address Federation |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.60.2" data-path="federation-queue.html"> |
| |
| <a href="federation-queue.html"> |
| |
| |
| Queue Federation |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| |
| </ul> |
| |
| </li> |
| |
| <li class="chapter " data-level="1.61" data-path="ha.html"> |
| |
| <a href="ha.html"> |
| |
| |
| High Availability and Failover |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.62" data-path="graceful-shutdown.html"> |
| |
| <a href="graceful-shutdown.html"> |
| |
| |
| Graceful Server Shutdown |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.63" data-path="libaio.html"> |
| |
| <a href="libaio.html"> |
| |
| |
| Libaio Native Libraries |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.64" data-path="thread-pooling.html"> |
| |
| <a href="thread-pooling.html"> |
| |
| |
| Thread management |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.65" data-path="web-server.html"> |
| |
| <a href="web-server.html"> |
| |
| |
| Embedded Web Server |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.66" data-path="logging.html"> |
| |
| <a href="logging.html"> |
| |
| |
| Logging |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.67" data-path="rest.html"> |
| |
| <a href="rest.html"> |
| |
| |
| REST Interface |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.68" data-path="embedding-activemq.html"> |
| |
| <a href="embedding-activemq.html"> |
| |
| |
| Embedding the Broker |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.69" data-path="karaf.html"> |
| |
| <a href="karaf.html"> |
| |
| |
| Apache Karaf |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.70" data-path="tomcat.html"> |
| |
| <a href="tomcat.html"> |
| |
| |
| Apache Tomcat |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.71" data-path="spring-integration.html"> |
| |
| <a href="spring-integration.html"> |
| |
| |
| Spring Integration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.72" data-path="cdi-integration.html"> |
| |
| <a href="cdi-integration.html"> |
| |
| |
| CDI Integration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.73" data-path="intercepting-operations.html"> |
| |
| <a href="intercepting-operations.html"> |
| |
| |
| Intercepting Operations |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.74" data-path="data-tools.html"> |
| |
| <a href="data-tools.html"> |
| |
| |
| Data Tools |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.75" data-path="maven-plugin.html"> |
| |
| <a href="maven-plugin.html"> |
| |
| |
| Maven Plugin |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.76" data-path="unit-testing.html"> |
| |
| <a href="unit-testing.html"> |
| |
| |
| Unit Testing |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.77" data-path="perf-tuning.html"> |
| |
| <a href="perf-tuning.html"> |
| |
| |
| Troubleshooting and Performance Tuning |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.78" data-path="configuration-index.html"> |
| |
| <a href="configuration-index.html"> |
| |
| |
| Configuration Reference |
| |
| </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>clustered - examples showing load balancing and distribution capabilities.</li> |
| <li>ha - examples showing failover and reconnection capabilities.</li> |
| <li>perf - examples allowing you to run a few performance tests on the server</li> |
| <li>standard - examples demonstrating various broker features.</li> |
| <li>sub-modules - examples of integrated external modules.</li> |
| </ul> |
| </li> |
| <li>protocols - Protocol specific examples<ul> |
| <li>amqp</li> |
| <li>mqtt</li> |
| <li>openwire</li> |
| <li>stomp</li> |
| </ul> |
| </li> |
| </ul> |
| <h2 id="running-the-examples">Running the Examples</h2> |
| <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 example, 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/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 2.5.0 |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] |
| [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-maven) @ queue --- |
| [INFO] |
| [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ queue --- |
| [INFO] |
| [INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ 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] Nothing to compile - all classes are up to date |
| [INFO] |
| [INFO] --- maven-checkstyle-plugin:2.17:check (default) @ queue --- |
| [INFO] |
| [INFO] --- apache-rat-plugin:0.12: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 /home/user/activemq-artemis/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: /home/user/activemq-artemis/examples/features/standard/queue/target/queue-2.5.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-maven) @ 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] |
| [INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ queue --- |
| [INFO] Building jar: /home/user/activemq-artemis/examples/features/standard/queue/target/queue-2.5.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-maven) @ 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] |
| [INFO] --- maven-source-plugin:2.2.1:jar (default) @ queue --- |
| [INFO] |
| [INFO] --- dependency-check-maven:1.4.3:check (default) @ queue --- |
| [INFO] Skipping dependency-check |
| [INFO] |
| [INFO] --- artemis-maven-plugin:2.5.0:create (create) @ queue --- |
| [INFO] Local id: <span class="hljs-built_in">local</span> |
| url: file:///home/user/.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:2.5.0 @ /home/user/activemq-artemis/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:2.5.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:2.5.0:create'</span> |
| role: <span class="hljs-string">'org.apache.maven.plugin.Mojo'</span>, implementation: <span class="hljs-string">'org.apache.activemq.artemis.maven.ArtemisDependencyScanPlugin'</span>, role hint: <span class="hljs-string">'org.apache.activemq:artemis-maven-plugin:2.5.0:dependency-scan'</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:2.5.0:runClient'</span> |
| --- |
| Executing org.apache.activemq.artemis.cli.commands.Create create --allow-anonymous --silent --force --user guest --password guest --role guest --port-offset 0 --data ./data --allow-anonymous --no-web --no-autotune --verbose --aio /home/user/activemq-artemis/examples/features/standard/queue/target/server0 |
| Home::/home/user/activemq-artemis/examples/features/standard/queue/../../../../artemis-distribution/target/apache-artemis-2.5.0-bin/apache-artemis-2.5.0, Instance::null |
| Creating ActiveMQ Artemis instance at: /home/user/activemq-artemis/examples/features/standard/queue/target/server0 |
| |
| You can now start the broker by executing: |
| |
| <span class="hljs-string">"/home/user/activemq-artemis/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">"/home/user/activemq-artemis/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 /home/user/activemq-artemis/examples/features/standard/queue/target |
| [INFO] <span class="hljs-comment">###################################################################################################</span> |
| [INFO] |
| [INFO] --- artemis-maven-plugin:2.5.0:cli (start) @ queue --- |
| [INFO] awaiting server to start |
| server-out: _ _ _ |
| server-out: / \ ____| |_ ___ __ __(_) _____ |
| server-out: / _ \| _ \ __|/ _ \ \/ | |/ __/ |
| server-out: / ___ \ | \/ |_/ __/ |\/| | |\___ \ |
| server-out: /_/ \_\| \__\____|_| |_|_|/___ / |
| server-out: Apache ActiveMQ Artemis 2.5.0 |
| server-out: |
| server-out: |
| server-out:2018-03-13 09:06:37,980 WARN [org.apache.activemq.artemis.core.server] AMQ222018: AIO was not located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to <span class="hljs-built_in">enable</span> the AIO journal |
| server-out:2018-03-13 09:06:38,052 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server |
| [INFO] awaiting server to start |
| server-out:2018-03-13 09:06:38,123 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:2018-03-13 09:06:38,146 INFO [org.apache.activemq.artemis.core.server] AMQ221013: Using NIO Journal |
| server-out:2018-03-13 09:06:38,178 INFO [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 1,073,741,824 |
| server-out:2018-03-13 09:06:38,197 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:2018-03-13 09:06:38,198 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:2018-03-13 09:06:38,198 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:2018-03-13 09:06:38,198 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:2018-03-13 09:06:38,199 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:2018-03-13 09:06:38,199 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support <span class="hljs-keyword">for</span>: STOMP |
| server-out:2018-03-13 09:06:38,261 INFO [org.apache.activemq.artemis.core.server] AMQ221034: Waiting indefinitely to obtain live lock |
| server-out:2018-03-13 09:06:38,262 INFO [org.apache.activemq.artemis.core.server] AMQ221035: Live Server Obtained live lock |
| server-out:2018-03-13 09:06:38,386 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying queue DLQ on address DLQ |
| server-out:2018-03-13 09:06:38,445 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying queue ExpiryQueue on address ExpiryQueue |
| [INFO] awaiting server to start |
| server-out:2018-03-13 09:06:38,739 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61616 <span class="hljs-keyword">for</span> protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE] |
| server-out:2018-03-13 09:06:38,741 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5445 <span class="hljs-keyword">for</span> protocols [HORNETQ,STOMP] |
| server-out:2018-03-13 09:06:38,742 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5672 <span class="hljs-keyword">for</span> protocols [AMQP] |
| server-out:2018-03-13 09:06:38,744 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:1883 <span class="hljs-keyword">for</span> protocols [MQTT] |
| server-out:2018-03-13 09:06:38,746 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61613 <span class="hljs-keyword">for</span> protocols [STOMP] |
| server-out:2018-03-13 09:06:38,752 INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live |
| server-out:2018-03-13 09:06:38,752 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.5.0 [0.0.0.0, nodeID=bf1853a1-26c7-11e8-9378<span class="hljs-_">-d</span>96702a756ed] |
| [INFO] Server started |
| [INFO] |
| [INFO] --- artemis-maven-plugin:2.5.0:runClient (runClient) @ queue --- |
| Sent message: This is a text message |
| Received message: This is a text message |
| [INFO] |
| [INFO] --- artemis-maven-plugin:2.5.0:cli (stop) @ queue --- |
| server-out:2018-03-13 09:06:40,888 INFO [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.5.0 [bf1853a1-26c7-11e8-9378<span class="hljs-_">-d</span>96702a756ed] stopped, uptime 2.786 seconds |
| server-out:Server stopped! |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] BUILD SUCCESS |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] Total time: 6.641 s |
| [INFO] Finished at: 2018-03-13T09:06:40-05:00 |
| [INFO] Final Memory: 43M/600M |
| [INFO] ------------------------------------------------------------------------ |
| </code></pre> |
| <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="camel">Camel</h2> |
| <p>The <code>camel</code> example demonstrates how to build and deploy a Camel route to the |
| broker using a web application archive (i.e. <code>war</code> file).</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 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 a broker within your own code using |
| POJO instantiation and no config files.</p> |
| <h2 id="embedded-simple">Embedded Simple</h2> |
| <p>The <code>embedded-simple</code> example shows how to embed a broker within your own code |
| using regular Apache ActiveMQ Artemis XML files.</p> |
| <h2 id="exclusive-queue">Exclusive Queue</h2> |
| <p>The <code>exlusive-queue</code> example shows you how to use exclusive queues, that route |
| all messages to only one consumer at a time.</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="interceptor-amqp">Interceptor AMQP</h2> |
| <p>Similar to the <a href="#interceptor">Interceptor</a> example, but using AMQP interceptors.</p> |
| <h2 id="interceptor-client">Interceptor Client</h2> |
| <p>Similar to the <a href="#interceptor">Interceptor</a> example, but using interceptors on |
| the <strong>client</strong> rather than the broker.</p> |
| <h2 id="interceptor-mqtt">Interceptor MQTT</h2> |
| <p>Similar to the <a href="#interceptor">Interceptor</a> example, but using MQTT interceptors.</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/from an |
| address/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 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. The virtual-topic-mapping examples shows how to |
| map the ActiveMQ 5.x Virtual Topic naming convention to work with the Artemis Address model.</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 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 an |
| address/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 security with |
| Apache ActiveMQ Artemis.</p> |
| <h2 id="security-ldap">Security LDAP</h2> |
| <p>The <code>security-ldap</code> example shows you how configure and use role based security |
| with Apache ActiveMQ Artemis & an embedded instance of the Apache DS LDAP |
| server.</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="slow-consumer">Slow Consumer</h2> |
| <p>The <code>slow-consumer</code> example shows you how to detect slow consumers and |
| configure a slow consumer policy in Apache ActiveMQ Artemis's</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.20","depth":1,"next":{"title":"Routing Messages With Wild Cards","level":"1.21","depth":1,"path":"wildcard-routing.md","ref":"wildcard-routing.md","articles":[]},"previous":{"title":"The Client Classpath","level":"1.19","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/artemis","issues":"https://issues.apache.org/jira/browse/ARTEMIS","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis User Guide and Reference Documentation"},"file":{"path":"examples.md","mtime":"2020-04-27T19:30:24.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2020-04-29T20:47:49.444Z"},"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> |
| |