ARTEMIS-489 update examples doc
This commit is contained in:
parent
b4d6ae0f2c
commit
afd1aeaf88
|
@ -1,11 +1,10 @@
|
||||||
Examples
|
Examples
|
||||||
========
|
========
|
||||||
|
|
||||||
The Apache ActiveMQ Artemis distribution comes with over 90 run out-of-the-box examples
|
The Apache ActiveMQ Artemis distribution comes with over 90 run out-of-the-box examples demonstrating many of the features.
|
||||||
demonstrating many of the features.
|
|
||||||
|
|
||||||
The examples are available in both the binary and source distribution under the `examples`
|
The examples are available in both the binary and source distribution under the `examples` directory. Examples are split
|
||||||
directory. Examples are split by the following source tree:
|
by the following source tree:
|
||||||
|
|
||||||
- features - Examples containing broker specific features.
|
- features - Examples containing broker specific features.
|
||||||
- ha - examples showing failover and reconnection capabilities.
|
- ha - examples showing failover and reconnection capabilities.
|
||||||
|
@ -18,42 +17,50 @@ directory. Examples are split by the following source tree:
|
||||||
- stomp
|
- stomp
|
||||||
- amqp
|
- amqp
|
||||||
|
|
||||||
A set of Java EE examples are also provided which need WildFly installed
|
A set of Java EE examples are also provided which need WildFly installed to be able to run.
|
||||||
to be able to run.
|
|
||||||
|
|
||||||
Examples
|
Runnning the Examples
|
||||||
========
|
=====================
|
||||||
|
|
||||||
To run any example, simply `cd` into the appropriate example directory
|
To run any example, simply `cd` into the appropriate example directory and type `mvn verify` or `mvn install` (For
|
||||||
and type `mvn verify` or `mvn install` (For details please read the readme.html in each
|
details please read the readme.html in each example directory).
|
||||||
example directory).
|
|
||||||
|
|
||||||
You can use the profile -Pexamples to run multiple examples under any example tree.
|
You can use the profile `-Pexamples` to run multiple examples under any example tree.
|
||||||
|
|
||||||
For each server, you will have a created server under ./target/server0 (some examples use more than one server).
|
For each server, you will have a created server under `./target/server0` (some examples use more than one server).
|
||||||
|
|
||||||
You have the option to disable the server running (say if you want to start the server manually) by simply specifying the -PnoServer profile
|
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 `-PnoServer` profile, e.g.:
|
||||||
|
|
||||||
This will run the example without a server:
|
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
# running an example without running the server
|
# running an example without running the server
|
||||||
mvn verify -PnoServer
|
mvn verify -PnoServer
|
||||||
```
|
```
|
||||||
|
|
||||||
Also under ./target there will be a script repeating the commands to create each server:
|
Also under `./target` there will be a script repeating the commands to create each server. Here is the `create-server0.sh`
|
||||||
|
generated by the `Queue` example. This is useful to see exactly what command(s) are required to configure the server(s).
|
||||||
|
|
||||||
Example this is create-server0.sh created for the queue example. It could be useful to see what we do on the example:
|
|
||||||
```sh
|
```sh
|
||||||
# These are the commands used to create server0
|
# 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
|
/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.
|
Several examples use UDP clustering which may not work in your environment by default. On linux the command would be:
|
||||||
|
|
||||||
This is the common output when running an example. On this case taken from the Queue example:
|
``` sh
|
||||||
|
route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
|
||||||
|
```
|
||||||
|
|
||||||
|
This command should be run as root. This will redirect any traffic directed to `224.0.0.0` to the loopback interface.
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
All the examples use 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
|
```sh
|
||||||
[INFO] Scanning for projects...
|
[INFO] Scanning for projects...
|
||||||
|
@ -187,14 +194,12 @@ server-out:17:30:27,476 INFO [org.apache.activemq.artemis.core.server] AMQ22100
|
||||||
[INFO] Finished at: 2015-09-01T17:30:27-04:00
|
[INFO] Finished at: 2015-09-01T17:30:27-04:00
|
||||||
[INFO] Final Memory: 42M/508M
|
[INFO] Final Memory: 42M/508M
|
||||||
[INFO] ------------------------------------------------------------------------
|
[INFO] ------------------------------------------------------------------------
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Applet
|
Applet
|
||||||
------
|
------
|
||||||
|
|
||||||
This example shows you how to send and receive JMS messages from an
|
This example shows you how to send and receive JMS messages from an Applet.
|
||||||
Applet.
|
|
||||||
|
|
||||||
Application-Layer Failover
|
Application-Layer Failover
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
Loading…
Reference in New Issue