Stardust/Knowledge Base/Integration/Spring Integration
Spring Integration is a light-weight framework that follows the Spring programming model and aims to implement well-known Enterprise Integration Patterns. It allows you to declaratively create a chain of message consuming and message producing components with capabilities for message routing, filtering, etc.
You can easily use existing Pojos as parts of this 'message bus' without any need to change them or you can extend the framework's adapters to have greater control over the message handling behavior.The following is an example for using Spring Integration with Stardust involving the handling of incoming files and a document repository.
File Archiver Example
This example consists of a Spring Integration solution with 3 components: The first is capable of monitoring a directory for incoming files, the second archives the file into a folder inside a JCR content repository (using Stardust's Document Management Service), and the third component starts a process in the Stardust runtime passing in the ID of the archived document to create an attachment.
Inbound File Adapter
This is an out-of-the-box Spring Integration adapter which monitors a directory for new files. Here's a configuration example in which a directory is polled every 3 seconds for new files starting with the name "test*" and every file processed is cached in a filter so it's not picked up a again in the next polling interval.. You can also see that every detected file is sent to the "fileMessages" channel.