You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/01/11 12:59:18 UTC
[3/5] camel git commit: A widget and gadget example from the EIP book
in plain Java.
A widget and gadget example from the EIP book in plain Java.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/40854ffd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40854ffd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40854ffd
Branch: refs/heads/master
Commit: 40854ffd526056280013a8beb1a8fa194d0563d6
Parents: abcd774
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Jan 11 12:56:09 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Jan 11 12:56:20 2016 +0100
----------------------------------------------------------------------
.../camel-example-widget-gadget-java/README.md | 27 ++++++++++++++++----
1 file changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/40854ffd/examples/camel-example-widget-gadget-java/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-widget-gadget-java/README.md b/examples/camel-example-widget-gadget-java/README.md
index fecb79b..d1a9338 100644
--- a/examples/camel-example-widget-gadget-java/README.md
+++ b/examples/camel-example-widget-gadget-java/README.md
@@ -1,4 +1,4 @@
-# Widget and Gadget Example
+# Widget and Gadget Example - Plain Java
### Introduction
@@ -25,14 +25,31 @@ You will need to build this example first:
This example requires an existing Apache ActiveMQ broker running.
-This application connects to the remote broker on url: tcp://localhost:61616.
+To setup and run Apache ActiveMQ then download it from the []ActiveMQ website](http://activemq.apache.org/).
+
+Then extract the download such as (the .tar)
+
+ tar xf ~/Downloads/apache-activemq-5.13.0-bin.tar.gz
+
+Then the broker can be started with
+
+ cd apache-activemq-5.13.0
+ bin/activemq console
+
+And then Broker is running (you can press `ctrl + c` in the shell to stop the broker).
+
+The Camel application connects to the remote broker on url: `tcp://localhost:61616`.
The url can be changed in the `WidgetMain.java` source code.
-When the ActiveMQ broker is running, then you can run this example using
+When the ActiveMQ broker is running, then you can run this example using:
mvn compile exec:java
-When the Camel application runs, you should see 2 orders being processed and logged to the console.
+When the Camel application runs, you should see 2 orders being processed and logged to the console, such as:
+```
+2016-01-11 12:53:53,978 [sumer[newOrder]] INFO widget - Exchange[ExchangePattern: InOnly, BodyType: byte[], Body: <order> <customerId>123</customerId> <product>widget</product> <amount>2</amount></order>]
+2016-01-11 12:53:54,005 [sumer[newOrder]] INFO gadget - Exchange[ExchangePattern: InOnly, BodyType: byte[], Body: <order> <customerId>456</customerId> <product>gadget</product> <amount>3</amount></order>]
+```
You can access the ActiveMQ web console using [http://localhost:8161/admin/](http://localhost:8161/admin/)
and then browse the queues. You should see the three queues:
@@ -41,6 +58,7 @@ and then browse the queues. You should see the three queues:
- widget
- gadget
+The Camel application can be stopped pressing `ctrl + c` in the shell.
### Configuration
@@ -59,5 +77,4 @@ If you hit an problems please let us know on the Camel Forums
Please help us make Apache Camel better - we appreciate any feedback you may
have. Enjoy!
-------------------------
The Camel riders!