From b686a8f0d97ca94463111de4e42f43ea09b75aa5 Mon Sep 17 00:00:00 2001 From: David Turanski Date: Sat, 3 Dec 2011 08:05:32 -0500 Subject: [PATCH] updated README --- applications/cafe-scripted/README.md | 27 +++++++++++++++ applications/cafe-scripted/error.out | 0 applications/cafe-scripted/readme.txt | 50 --------------------------- 3 files changed, 27 insertions(+), 50 deletions(-) create mode 100644 applications/cafe-scripted/README.md delete mode 100644 applications/cafe-scripted/error.out delete mode 100644 applications/cafe-scripted/readme.txt diff --git a/applications/cafe-scripted/README.md b/applications/cafe-scripted/README.md new file mode 100644 index 00000000..53119680 --- /dev/null +++ b/applications/cafe-scripted/README.md @@ -0,0 +1,27 @@ +Cafe Demo - Scripted Implementation +=================================== + +This is the scripted implementation of the classic **cafe** sample application. You can choose among **javascript**, +**groovy**, **ruby**, and **python** scripting languages. The functionality is basically identical in all cases to the +original cafe demo. + +# Instructions for running the CafeDemo sample + +The script language is passed as a command line argument. This may be run directly from maven: +>mvn clean compile + +>mvn exec:exec -Dlang=[language] + +## Groovy Control Bus +This sample also demonstrates the use of Spring Integration's **groovy control bus** which accepts +Groovy scripts as control messages. These scripts may invoke lifecycle operations on adapters or +operations on managed beans. + +To demonstrate the control bus, while the CafeDemoApp is running, execute in a separate window: + +>mvn exec:exec -Pcontrol-bus + +This will use groovy scripts to + * Query the waiter for the total number of orders delivered + * If the total orders > 3, stop the inbound adaptor on the cafe (the order flow). The Cafe application + will continue to run, but eventually the output will stop when all pending orders have completed. diff --git a/applications/cafe-scripted/error.out b/applications/cafe-scripted/error.out deleted file mode 100644 index e69de29b..00000000 diff --git a/applications/cafe-scripted/readme.txt b/applications/cafe-scripted/readme.txt deleted file mode 100644 index 2bd00e6a..00000000 --- a/applications/cafe-scripted/readme.txt +++ /dev/null @@ -1,50 +0,0 @@ -This is the scripted implementation of the standard cafe sample application. You can choose among javascript, -groovy, ruby, and python scripting languages. The functionality is basically identical in all cases to the -original cafe demo. - -Instructions for running the CafeDemo sample -------------------------------------------------------------------------------- -The script language is passed as a command line argument. This may be run directly from maven: ->mvn clean compile - ->mvn exec:exec -Dlang=[language] - -This sample also demonstrates the use of Spring Integration's groovy control bus which enables -control bus messages to be Groovy scripts which may invoke operations on application components. - -To demonstrate the control bus, while the CafeDemoApp is running, execute in a separate window: - ->mvn exec:exec -Pcontrol-bus - -This will use groovy scripts to - - Query the waiter for the total number of orders delivered - - If the total orders > 3, stop the inbound adaptor on the cafe (the order flow). The Cafe application - will continue to run, but eventually the output will stop when all pending orders have completed. - -The Cafe sample emulates a simple operation of the Coffee shop shop when modeled using EIP -It is inspired by one of the samples featured in Gregor Hohpe's Ramblings. -The domain is that of a Cafe, and the basic flow is depicted in the following diagram: - - - Barista (scripted) - hotDrinks _______________________ - |==========| -->| | - orders drinks / | prepareDrink() | -Place Order ->Customer->|======|->OrderSplitter->|======|->DrinkRouter | timeToPrepare=5 sec | - (scripted) (scripted) \ coldDrinks | prepareDrink() | - |==========| -->| timeToPrepare=1 sec | - |_______________________| - - Legend: |====| - channels - - -The Order object may contain multiple OrderItems. Once the order is placed, a Splitter will break the -composite order message into a single message per drink. Each of these is then processed by a Router that -determines whether the drink is hot or cold (checking the OrderItem object's 'isIced' property). The Barista -prepares each drink. Hot and cold drink preparation are handled by two distinct script invocations of -'prepareDrink', each with different variable assignments. - -The prepared drinks are then sent to the Waiter where they are aggregated into a Delivery object. - - -Happy integration :-) \ No newline at end of file