ARTEMIS-489 update examples doc
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/afd1aeaf Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/afd1aeaf Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/afd1aeaf Branch: refs/heads/master Commit: afd1aeaf88466e80d37682c9fd3cbdaf0b400078 Parents: b4d6ae0 Author: jbertram <[email protected]> Authored: Mon Apr 18 15:16:05 2016 -0500 Committer: Clebert Suconic <[email protected]> Committed: Mon Apr 18 17:50:53 2016 -0400 ---------------------------------------------------------------------- docs/user-manual/en/examples.md | 53 ++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd1aeaf/docs/user-manual/en/examples.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/examples.md b/docs/user-manual/en/examples.md index 34e7c23..fca4653 100644 --- a/docs/user-manual/en/examples.md +++ b/docs/user-manual/en/examples.md @@ -1,11 +1,10 @@ Examples ======== -The Apache ActiveMQ Artemis distribution comes with over 90 run out-of-the-box examples -demonstrating many of the features. +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 both the binary and source distribution under the `examples` -directory. Examples are split by the following source tree: +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. @@ -18,42 +17,50 @@ directory. Examples are split by the following source tree: - stomp - amqp -A set of Java EE examples are also provided which need WildFly installed -to be able to run. +A set of Java EE examples are also provided which need WildFly installed to be able to run. -Examples -======== - -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). +Runnning the Examples +===================== -You can use the profile -Pexamples to run multiple examples under any example tree. +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). -For each server, you will have a created server under ./target/server0 (some examples use more than one server). +You can use the profile `-Pexamples` to run multiple examples under any example tree. -You have the option to disable the server running (say if you want to start the server manually) by simply specifying the -PnoServer profile +For each server, you will have a created server under `./target/server0` (some examples use more than one server). - -This will run the example without a server: +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.: ``` 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: +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 # 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. +Several examples use UDP clustering which may not work in your environment by default. On linux the command would be: + +``` 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 +``` -This is the common output when running an example. On this case taken from the Queue example: +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 [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] Final Memory: 42M/508M [INFO] ------------------------------------------------------------------------ - ``` Applet ------ -This example shows you how to send and receive JMS messages from an -Applet. +This example shows you how to send and receive JMS messages from an Applet. Application-Layer Failover --------------------------
