Readme.md now contains a "First Fifteen Minutes" guide to building and running the container and a 'hello-world' example.
Project: http://git-wip-us.apache.org/repos/asf/river-container/repo Commit: http://git-wip-us.apache.org/repos/asf/river-container/commit/496e36fc Tree: http://git-wip-us.apache.org/repos/asf/river-container/tree/496e36fc Diff: http://git-wip-us.apache.org/repos/asf/river-container/diff/496e36fc Branch: refs/heads/master Commit: 496e36fcbf192165a027343af29db09a7572a0e4 Parents: 33855de Author: Greg Trasuk <tras...@trasuk.com> Authored: Tue Feb 18 09:14:41 2014 -0500 Committer: Greg Trasuk <tras...@trasuk.com> Committed: Tue Feb 18 09:14:41 2014 -0500 ---------------------------------------------------------------------- README.md | 104 ++++++++++++++++++- .../src/main/root/profile/default/config.xml | 5 + 2 files changed, 105 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/river-container/blob/496e36fc/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 23a59d7..7e59b85 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,103 @@ river-container =============== -Initial development on Apache River Container +This project is the initial development of the Apache River Container. +It is _not_ yet released as Apache Software. Use at your own risk, and please +post comments to d...@river.apache.org. + +The First Fifteen Minutes +========================= + +Let's assume you've managed to download the source from git. In fact, let's assume that +you're reasonably conversant with git, so you can pull the examples project below. + +# Before You Start +You'll need Maven 3.x installed, such that you can run 'mvn' from the command +line. + +# Build From Source + +<i>This step may not be required in the future, since you'll be able to +download a convenience binary once the project is released</i> + +Go to the root of the river-container download, and type + mvn clean install + +# Run the default container profile + cd product/target/product* + bin/run + +The steps above will startup a default container that has instances of the +service registrar (Reggie) and the transaction manager (Mahalo). All services +are registered in a workgroup called 'RiverContainerDefault'. + +# Run the service browser +Open a new command line window in the root of the river-container download, then +do the following + cd product/target/product* + bin/run client browser + +You'll see a service browser window open up. It should show one registrar. +Select the registrar. You should now see the infrastructure services, Reggie and +Mahalo. Leave the service browser running while we start up a "Hello-world" +service, below. + +# Compile a "Hello-World" Service + +<i>Maybe the 'hello-world' example should be included in the container deliverable? +Please comment on 'd...@river.apache.org'.</i> + +<i>Eventually, we should be able to create this example service using a Maven +archetype.</i> + +Using git, pull the examples from https://github.com/trasukg/river-container-examples. + +'cd' into your hello-example' directory, and then + mvn clean install + +# Deploy and run the "Hello-World" Service + +When Maven is done, you should be able to see the finished service archive, +'hello-module/target/hello-module-1.0-SNAPSHOT.jar' + +Copy that 'jar' file into the +'profiles/default/deploy' folder inside our 'river-container/product/target/product*' folder. + +<i>Eventually, we'll have a maven plugin that does this, so you can just do +'mvn river:deploy' rather than copying it manually.</i> + +If you left the container running, you should see some output indicating that the +service is being deployed. If you didn't leave the container running, start it up now. + +You should also see the service in the service browser, with the interface +'org.apache.river.container.hello.example.api.Greeter' + +# Deploy and Run the "Hello-World" Consumer + +When Maven finished above, it also created a client archive, +'hello-client-module/target/hello-client-module-1.0-SNAPSHOT.jar' + +Copy that 'jar' file into the +'profiles/client/deploy' folder inside our 'river-container/product/target/product*' folder. + +Open a new command line window in the root of the river-container download, then +do the following + cd product/target/product* + bin/run client hello-client + +The client starts up, and eventually prompts 'Please enter your name'. Enter +your name and then press return. + +The client sends the greeter service a message, then prints out the reply. + +# Use the Network! + +If you have another machine on the local area network, and if the network is +configured to allow multicast, you should be able to run the browser and the +hello-client on a different machine. + +That concludes the 'First Fifteen Minutes' demo. Below, there is a little more +detailed information... # Building from Source @@ -28,7 +124,7 @@ Initial development on Apache River Container # Running Services in the Container cd product/target/product* - sh bin/run.sh [profile] arg* + bin/run [profile] arg* If you don't specify [profile] the 'default' profile will be used. 'arg*' isn't really used much in the service container profiles (like 'default'). @@ -48,7 +144,7 @@ what the archive should look like. Startup parameters are in 'start.properties' # Running Client Applications cd product/target/product* - sh bin/run.sh client AppName arg* + bin/run client AppName arg* Starts up the container using the 'client' profile, which then starts the client that is named by 'AppName' (and only that client, no matter if there are multiple @@ -61,7 +157,7 @@ Client apps are packaged much like the services mentioned above. # Service Browser cd product/target/product* - sh bin/run.sh client browser + bin/run client browser Starts up the service browser. http://git-wip-us.apache.org/repos/asf/river-container/blob/496e36fc/product/src/main/root/profile/default/config.xml ---------------------------------------------------------------------- diff --git a/product/src/main/root/profile/default/config.xml b/product/src/main/root/profile/default/config.xml index cd21bc2..22be40b 100644 --- a/product/src/main/root/profile/default/config.xml +++ b/product/src/main/root/profile/default/config.xml @@ -32,7 +32,12 @@ xsi:schemaLocation='http://river.apache.org/xml/ns/container/config/1.0 file:/home/trasukg/development/surrogate/src/schemas/config.xsd'> <cfg:property name="deploymentDirectory" value="deploy"/> + <!-- Change this value to change the discovery group for the container. + In the default 'service-starter.cfg', this value is made available inside + service starter configuration files as '$discoveryGroup'. + --> <cfg:property name="defaultDiscoveryGroup" value="RiverContainerDefault"/> + <cfg:component class="org.apache.river.container.work.ContextualWorkManager"/> <cfg:component class="org.apache.river.container.work.BasicWorkManager"/> <cfg:component class="org.apache.river.container.codebase.ClassServer"/>