This closes #149 pre-release work with doc and examples changes
This commit is contained in:
commit
c998e9a445
|
@ -53,6 +53,7 @@
|
|||
* [Intercepting Operations](intercepting-operations.md)
|
||||
* [Protocols and Interoperability](protocols-interoperability.md)
|
||||
* [Tools](tools.md)
|
||||
* [Performance Tuning](perf-tuning.md)
|
||||
* [Maven Plugin](maven-plugin.md)
|
||||
* [Troubleshooting and Performance Tuning](perf-tuning.md)
|
||||
* [Configuration Reference](configuration-index.md)
|
||||
|
||||
|
|
Binary file not shown.
|
@ -4,31 +4,191 @@ Examples
|
|||
The Apache ActiveMQ Artemis distribution comes with over 90 run out-of-the-box examples
|
||||
demonstrating many of the features.
|
||||
|
||||
The examples are available in the distribution, in the `examples`
|
||||
directory. Examples are split into JMS and core examples. JMS examples
|
||||
show how a particular feature can be used by a normal JMS client. Core
|
||||
examples show how the equivalent feature can be used by a core messaging
|
||||
client.
|
||||
The examples are available in both the binary and source distribution under the `examples`
|
||||
directory. Examples are split by the following source tree:
|
||||
|
||||
- features - Examples containing broker specific features.
|
||||
- ha - examples showing failover and reconnection capabilities.
|
||||
- clustered - examples showing load balancing and distribution capabilities.
|
||||
- perf - examples allowing you to run a few performance tests on the server
|
||||
- sub-modules - examples of integrated external modules.
|
||||
- protocols - Protocol specific examples
|
||||
- openwire
|
||||
- mqtt
|
||||
- stomp
|
||||
- amqp
|
||||
|
||||
A set of Java EE examples are also provided which need WildFly installed
|
||||
to be able to run.
|
||||
|
||||
JMS Examples
|
||||
============
|
||||
Examples
|
||||
========
|
||||
|
||||
To run a JMS example, simply `cd` into the appropriate example directory
|
||||
and type `mvn verify -Pexample` (For details please read the readme.html in each
|
||||
To run any example, simply `cd` into the appropriate example directory
|
||||
and type `mvn verify` or `mvn install` (For details please read the readme.html in each
|
||||
example directory).
|
||||
|
||||
Here's a listing of the examples with a brief description.
|
||||
You can use the profile -Pexamples to run multiple examples under any example tree.
|
||||
|
||||
JMS AeroGear
|
||||
------------
|
||||
For each server, you will have a created server under ./target/server0 (some examples use more than one server).
|
||||
|
||||
This example shows how you can send a message to a mobile device by
|
||||
leveraging AeroGears push technology which provides support for
|
||||
different push notification technologies like Google Cloud Messaging,
|
||||
Apple's APNs or Mozilla's SimplePush.
|
||||
You have the option to disable the server running (say if you want to start the server manually) by simply specifying the -PnoServer profile
|
||||
|
||||
|
||||
This will run the example without a server:
|
||||
|
||||
``` sh
|
||||
# running an example without running the server
|
||||
mvn verify -PnoServer
|
||||
```
|
||||
|
||||
Also under ./target there will be a script repeating the commands to create each server:
|
||||
|
||||
Example this is create-server0.sh created for the queue example. It could be useful to see what we do on the example:
|
||||
```sh
|
||||
# These are the commands used to create server0
|
||||
/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
|
||||
```
|
||||
|
||||
These examples are all using the [Maven plugin](maven-plugin.md), which can be useful for running your test servers as well.
|
||||
|
||||
This is the common output when running an example. On this case taken from the Queue example:
|
||||
|
||||
|
||||
```sh
|
||||
[INFO] Scanning for 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 'UTF-8' 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 source 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 'rat.skip'.
|
||||
[INFO]
|
||||
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ queue ---
|
||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
||||
[INFO] skip non existing resourceDirectory /work/apache-artemis-1.1.0/examples/features/standard/queue/src/test/resources
|
||||
[INFO] Copying 3 resources
|
||||
[INFO]
|
||||
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ queue ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] --- maven-surefire-plugin:2.18.1:test (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: local
|
||||
url: file:///Users/apacheuser/.m2/repository/
|
||||
layout: default
|
||||
snapshots: [enabled => true, update => always]
|
||||
releases: [enabled => true, 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: 'org.apache.maven.plugin.Mojo', implementation: 'org.apache.activemq.artemis.maven.ArtemisCLIPlugin', role hint: 'org.apache.activemq:artemis-maven-plugin:1.1.0:cli'
|
||||
role: 'org.apache.maven.plugin.Mojo', implementation: 'org.apache.activemq.artemis.maven.ArtemisCreatePlugin', role hint: 'org.apache.activemq:artemis-maven-plugin:1.1.0:create'
|
||||
role: 'org.apache.maven.plugin.Mojo', implementation: 'org.apache.activemq.artemis.maven.ArtemisClientPlugin', role hint: 'org.apache.activemq:artemis-maven-plugin:1.1.0:runClient'
|
||||
---
|
||||
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:
|
||||
|
||||
"/work/apache-artemis-1.1.0/examples/features/standard/queue/target/server0/bin/artemis" run
|
||||
|
||||
Or you can run the broker in the background using:
|
||||
|
||||
"/work/apache-artemis-1.1.0/examples/features/standard/queue/target/server0/bin/artemis-service" start
|
||||
|
||||
[INFO] ###################################################################################################
|
||||
[INFO] create-server0.sh created with commands to reproduce server0
|
||||
[INFO] under /work/apache-artemis-1.1.0/examples/features/standard/queue/target
|
||||
[INFO] ###################################################################################################
|
||||
[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=false,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 for: CORE
|
||||
server-out:17:30:25,199 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
|
||||
server-out:17:30:25,209 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
|
||||
server-out:17:30:25,211 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT
|
||||
server-out:17:30:25,214 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
|
||||
server-out:17:30:25,335 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: 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 for 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 for 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 for protocols [AMQP]
|
||||
server-out:17:30:25,944 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:1883 for protocols [MQTT]
|
||||
server-out:17:30:25,948 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started Acceptor at 0.0.0.0:61613 for 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] ------------------------------------------------------------------------
|
||||
|
||||
```
|
||||
|
||||
Applet
|
||||
------
|
||||
|
@ -471,6 +631,8 @@ OpenWire
|
|||
The `Openwire` example shows how to configure an Apache ActiveMQ Artemis server to
|
||||
communicate with an Apache ActiveMQ Artemis JMS client that uses open-wire protocol.
|
||||
|
||||
You will find the queue example for open wire, and the chat example.
|
||||
|
||||
Paging
|
||||
------
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 61 KiB |
|
@ -62,16 +62,18 @@ These are the required linux packages to be installed for the compilation to wor
|
|||
|
||||
- libaio-dev - Compilation support for libaio
|
||||
|
||||
- cmake
|
||||
|
||||
- A full JDK installed with the environment variable JAVA\_HOME set to
|
||||
its location
|
||||
|
||||
To perform this installation on RHEL or Fedora, you can simply type this at a command line:
|
||||
|
||||
sudo yum install libtool gcc-c++ gcc libaio libaio-devel
|
||||
sudo yum install libtool gcc-c++ gcc libaio libaio-devel cmake
|
||||
|
||||
Or on Debian systems:
|
||||
|
||||
sudo apt-get install libtool gcc-g++ gcc libaio libaio-dev
|
||||
sudo apt-get install libtool gcc-g++ gcc libaio libaio- cmake
|
||||
|
||||
> **Note**
|
||||
>
|
||||
|
@ -82,26 +84,7 @@ Or on Debian systems:
|
|||
## Invoking the compilation
|
||||
|
||||
In the source distribution or git clone, in the `artemis-native` directory, execute the shell
|
||||
script `compile-native.sh`. This script will invoke the proper maven profile to perform the native build.
|
||||
script `compile-native.sh`. This script will invoke the proper commands to perform the native build.
|
||||
|
||||
someUser@someBox:/checkout-dir/artemis-native$ ./compile-native.sh
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Building ActiveMQ Artemis Native POM 1.0.0
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO]
|
||||
[INFO] --- nar-maven-plugin:3.0.0:nar-validate (default-nar-validate) @ artemis-native ---
|
||||
[INFO] Using AOL: amd64-Linux-gpp
|
||||
[INFO]
|
||||
[INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ artemis-native ---
|
||||
...
|
||||
If you want more information refer to the [cmake web pages](http://cmake.org).
|
||||
|
||||
The produced library will be at
|
||||
`./target/nar/artemis-native-RELEASE-amd64-Linux-gpp-jni/lib/amd64-Linux-gpp/jni/
|
||||
libartemis-native-RELEASE.so`. Simply move that file over
|
||||
`bin` with the proper rename [library
|
||||
path](#using-server.library.path).
|
||||
|
||||
If you want to perform changes on the Apache ActiveMQ Artemis libaio code, you could
|
||||
just call make directly at the `native-src` directory.
|
||||
|
|
|
@ -0,0 +1,223 @@
|
|||
# Maven Plugins
|
||||
|
||||
Since Artemis 1.1.0 Artemis provides the possibility of using Maven Plugins to manage the life cycle of servers.
|
||||
|
||||
## When to use it
|
||||
|
||||
These Maven plugins were initially created to manage server instances across our examples. They can create a server, start, and do any CLI operation over servers.
|
||||
|
||||
You could for example use these maven plugins on your testsuite or deployment automation.
|
||||
|
||||
|
||||
## Goals
|
||||
|
||||
There are three goals that you can use
|
||||
|
||||
- create
|
||||
|
||||
This will create a server accordingly to your arguments. You can do some extra tricks here such as installing extra libraries for external modules.
|
||||
|
||||
- cli
|
||||
|
||||
This will perform any CLI operation. This is basically a maven expression of the CLI classes
|
||||
|
||||
- runClient
|
||||
|
||||
This is a simple wrapper around classes implementing a static main call. Notice that this won't spawn a new VM or new Thread.
|
||||
|
||||
|
||||
## Declaration
|
||||
|
||||
On your pom, use the plugins section:
|
||||
|
||||
```xml
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>artemis-maven-plugin</artifactId>
|
||||
```
|
||||
|
||||
## create goal
|
||||
|
||||
I won't detail every operation of the create plugin here, but I will try to describe the main parameters:
|
||||
|
||||
Name | Description
|
||||
:--- | :---
|
||||
configuration | A place that will hold any file to replace on the configuration. For instance if you are providing your own broker.xml. Default is "${basedir}/target/classes/activemq/server0"
|
||||
home | The location where you downloaded and installed artemis. Default is "${activemq.basedir}"
|
||||
alternateHome | This is used case you have two possible locations for your home (e.g. one under compile and one under production
|
||||
instance | Where the server is going to be installed. Default is "${basedir}/target/server0"
|
||||
liblist[] | A list of libraries to be installed under ./lib. ex: "org.jgroups:jgroups:3.6.0.Final"
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
```xml
|
||||
<executions>
|
||||
<execution>
|
||||
<id>create</id>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<ignore>${noServer}</ignore>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
```
|
||||
|
||||
|
||||
## cli goal
|
||||
|
||||
Some properties for the CLI
|
||||
|
||||
Name | Description
|
||||
:--- | :---
|
||||
configuration | A place that will hold any file to replace on the configuration. For instance if you are providing your own broker.xml. Default is "${basedir}/target/classes/activemq/server0"
|
||||
home | The location where you downloaded and installed artemis. Default is "${activemq.basedir}"
|
||||
alternateHome | This is used case you have two possible locations for your home (e.g. one under compile and one under production
|
||||
instance | Where the server is going to be installed. Default is "${basedir}/target/server0"
|
||||
|
||||
|
||||
Similarly to the create plugin, the artemis exampels are using the cli plugin. Look at them for concrete examples.
|
||||
|
||||
Example:
|
||||
```xml
|
||||
<execution>
|
||||
<id>start</id>
|
||||
<goals>
|
||||
<goal>cli</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<spawn>true</spawn>
|
||||
<ignore>${noServer}</ignore>
|
||||
<testURI>tcp://localhost:61616</testURI>
|
||||
<args>
|
||||
<param>run</param>
|
||||
</args>
|
||||
</configuration>
|
||||
</execution>
|
||||
```
|
||||
|
||||
|
||||
### runClient goal
|
||||
|
||||
This is a simple solution for running classes implementing the main method.
|
||||
|
||||
Name | Description
|
||||
:--- | :---
|
||||
clientClass | A class implement a static void main(String arg[])
|
||||
args | A string array of arguments passed to the method
|
||||
|
||||
Example:
|
||||
|
||||
```xml
|
||||
<execution>
|
||||
<id>runClient</id>
|
||||
<goals>
|
||||
<goal>runClient</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
```
|
||||
|
||||
### Complete example
|
||||
|
||||
|
||||
The following example is a copy of the /examples/features/standard/queue example. You may refer to it directly under the examples directory tree.
|
||||
|
||||
```xml
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.activemq.examples.broker</groupId>
|
||||
<artifactId>jms-examples</artifactId>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>queue</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>ActiveMQ Artemis JMS Queue Example</name>
|
||||
|
||||
<properties>
|
||||
<activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>artemis-jms-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>artemis-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>create</id>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<ignore>${noServer}</ignore>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>start</id>
|
||||
<goals>
|
||||
<goal>cli</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<spawn>true</spawn>
|
||||
<ignore>${noServer}</ignore>
|
||||
<testURI>tcp://localhost:61616</testURI>
|
||||
<args>
|
||||
<param>run</param>
|
||||
</args>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>runClient</id>
|
||||
<goals>
|
||||
<goal>runClient</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>stop</id>
|
||||
<goals>
|
||||
<goal>cli</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<ignore>${noServer}</ignore>
|
||||
<args>
|
||||
<param>stop</param>
|
||||
</args>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq.examples.broker</groupId>
|
||||
<artifactId>queue</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
```
|
|
@ -250,4 +250,23 @@ tunings won't apply to JDKs from other providers (e.g. IBM or JRockit)
|
|||
yourself do you really need MDBs? Can you accomplish the same task
|
||||
using just a normal message consumer?
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### UDP not working
|
||||
|
||||
In certain situations UDP used on discovery may not work. Typical situations are:
|
||||
|
||||
1. The nodes are behind a firewall. If your nodes are on different machines then it is possible that the firewall is blocking the multicasts. you can test this by disabling the firewall for each node or adding the appropriate rules.
|
||||
2. You are using a home network or are behind a gateway. Typically home networks will redirect any UDP traffic to the Internet Service Provider which is then either dropped by the ISP or just lost. To fix this you will need to add a route to the firewall/gateway that will redirect any multicast traffic back on to the local network instead.
|
||||
3. All the nodes are in one machine. If this is the case then it is a similar problem to point 2 and the same solution should fix it. Alternatively you could add a multicast route to the loopback interface. On linux the command would be:
|
||||
```sh
|
||||
# you should run this as root
|
||||
route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
|
||||
```
|
||||
This will redirect any traffic directed to the 224.0.0.0 to the loopback interface. This will also work if you have no network at all.
|
||||
|
||||
* on Mac OS X, the command is slightly different:
|
||||
```sh
|
||||
sudo route add 224.0.0.0 127.0.0.1 -netmask 240.0.0.0
|
||||
```
|
||||
|
||||
|
|
|
@ -22,6 +22,13 @@ directory but before you do you will need to up the memory used by running:
|
|||
```
|
||||
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
|
||||
```
|
||||
|
||||
if you are running a Mac OS, you may want to add this to run the clustered examples:
|
||||
|
||||
```
|
||||
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
|
||||
```
|
||||
|
||||
### Recreating the examples
|
||||
|
||||
If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
|
||||
|
|
|
@ -59,6 +59,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<clustered>true</clustered>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -71,6 +73,8 @@ under the License.
|
|||
<instance>${basedir}/target/server1</instance>
|
||||
<clustered>true</clustered>
|
||||
<portOffset>1</portOffset>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -83,6 +87,8 @@ under the License.
|
|||
<instance>${basedir}/target/server2</instance>
|
||||
<clustered>true</clustered>
|
||||
<portOffset>2</portOffset>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -139,6 +145,8 @@ under the License.
|
|||
<goal>runClient</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- you may have to set export MAVEN_OPTS="-Djava.net.preferIPv4Stack=true"
|
||||
if you are on MacOS for instance -->
|
||||
<clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</clientClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
|
|
@ -60,6 +60,8 @@ under the License.
|
|||
<clustered>true</clustered>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -73,6 +75,8 @@ under the License.
|
|||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<portOffset>1</portOffset>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -59,6 +59,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -70,6 +72,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -81,6 +85,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server2</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server2</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -63,6 +63,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -78,6 +80,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -59,6 +59,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -70,6 +72,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -64,6 +64,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -75,6 +77,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -86,6 +90,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server2</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server2</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -64,6 +64,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -75,6 +77,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -86,6 +90,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server2</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server2</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -59,6 +59,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -70,6 +72,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -59,6 +59,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -70,6 +72,8 @@ under the License.
|
|||
<ignore>${noServer}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<!-- this makes it easier in certain envs -->
|
||||
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
|
@ -59,7 +59,7 @@ under the License.
|
|||
<ignore>${noSever}</ignore>
|
||||
<instance>${basedir}/target/server0</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server0</configuration>
|
||||
<javaOptions>-Dudp-address=${udp-address}</javaOptions>
|
||||
<javaOptions>-Dudp-address=${udp-address} -Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -71,7 +71,7 @@ under the License.
|
|||
<ignore>${noSever}</ignore>
|
||||
<instance>${basedir}/target/server1</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server1</configuration>
|
||||
<javaOptions>-Dudp-address=${udp-address}</javaOptions>
|
||||
<javaOptions>-Dudp-address=${udp-address} -Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -83,7 +83,7 @@ under the License.
|
|||
<ignore>${noSever}</ignore>
|
||||
<instance>${basedir}/target/server2</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server2</configuration>
|
||||
<javaOptions>-Dudp-address=${udp-address}</javaOptions>
|
||||
<javaOptions>-Dudp-address=${udp-address} -Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -95,7 +95,7 @@ under the License.
|
|||
<ignore>${noSever}</ignore>
|
||||
<instance>${basedir}/target/server3</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server3</configuration>
|
||||
<javaOptions>-Dudp-address=${udp-address}</javaOptions>
|
||||
<javaOptions>-Dudp-address=${udp-address} -Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -107,7 +107,7 @@ under the License.
|
|||
<ignore>${noSever}</ignore>
|
||||
<instance>${basedir}/target/server4</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server4</configuration>
|
||||
<javaOptions>-Dudp-address=${udp-address}</javaOptions>
|
||||
<javaOptions>-Dudp-address=${udp-address} -Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -119,7 +119,7 @@ under the License.
|
|||
<ignore>${noSever}</ignore>
|
||||
<instance>${basedir}/target/server5</instance>
|
||||
<configuration>${basedir}/target/classes/activemq/server5</configuration>
|
||||
<javaOptions>-Dudp-address=${udp-address}</javaOptions>
|
||||
<javaOptions>-Dudp-address=${udp-address} -Djava.net.preferIPv4Stack=true</javaOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
Loading…
Reference in New Issue