-
Notifications
You must be signed in to change notification settings - Fork 33
Introduction
This page will give you a quick introduction to ideas and inspirations behind Spring Integration (SI) Scala DSL and will provide you with the relevant links to help you get started.
For more on Spring Integration follow these links:
Spring Integration Reference manual
The goals of the project are:
- provide a strongly-typed Scala alternative to XML style configuration
- raise awareness of Spring Integration in Scala community
- provide seamless integration with Java (configure SI in Scala code in Java)
The idea for the style of DSL you'll see below was inspired from the simple text-based way of documenting pipes-and-filters Messaging architectures
pipe -> filter -> pipe -> filter -> ...
and in the current state of the DSL the above flow would be implemented like this:
filter.using{...} --> transform.using{...} --> split.using{...}
where custom code is provided as Scala functions (e.g., filter.using{payload:String => !payload.equals("foo")}) or java beans (to be supported shortly)
Through many internal and public dialogs it became clear that using verb representation of EIP patterns makes DSL that much simper to read, therefore instead of seeing transformer we use transform to identify a transformer. It becomes even clearer once you assume a Message making its way through the flow. For example; The above flow might be read as "Filter Message using [some code], then transform resulting Message using [some code] and than split the resulting Message using [some code]"
We're using '-->' operator which essentially depicts the direction of the flow and identifies the next EIP component in the Message flow composition.
For those familiar with XML style of SI configuration the above configuration would look like this:
<int:filter input-channel="A" output-channel="B" .../>
<int:transform input-channel="B" output-channel="C" .../>
<int:split input-channel="C" output-channel="D" .../>
. . .
[Back to Home] (https://github.com/SpringSource/spring-integration-scala/wiki)