Files
spring-integration-samples/applications/cafe-scripted
Gunnar Hillert 85bef285d4 INTSAMPLES-47 - Upgrade SI dep. to 2.1.0.RELEASE
* Upgraded all Spring Integration dependencies to 2.1.0.RELEASE
* All Samples use the new Artifactory-based Milestone Repository http://repo.springsource.org/milestone (As the repositories are additive, this repository will also include the release repo)
* Added versions to all Maven plugin declarations, reducing the amount WARNING-level logging substantially
2012-01-07 22:58:10 -05:00
..
2011-11-29 16:51:19 -05:00
2011-12-03 08:16:02 -05:00
2011-11-29 16:51:19 -05:00
2011-12-03 08:05:32 -05:00

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.