Spring Integration Series – Getting started

In the past few months I’ve had the good fortune of getting familiar in depth with Spring Integration and being responsible for adopting it for use within a major investment bank. I’ve learnt a lot through many different channels, met in person with people from SpringSource and those directly contributing to Spring Integration and provided my own feedback through all these channels derived from my experiences in using it to fulfil my commercial use-cases.

During all this time I’ve been dying to blog about Spring Integration and particularly my use of it but haven’t been able to due to lack of time and energy outside of work. Going forward, however, my hope is that I’ll write a series of articles, one at a time, each exploring a different perspective on Spring Integration.

Here we begin by looking at how to get started with Spring Integration and how to get close to the source of the project using Eclipse IDE. The value of this will be felt most when browsing the org.springframework.integration.samples project which contains numerous fully working examples of how to use Spring Integration in different ways.

Getting started

My approach to learning any new subject is to put theory first. Here’s what I did to get started.

  1. Read the manual (yes the entire ~100 pages).
  2. Set up the source (as in the next section of this article).
  3. Review the sample applications (once you’ve set up the source).

If you prefer a more pragmatic approach from the start you can dive straight into the sample applications and start to write your own by referring to the manual as and when needed but this approach has the danger of leaving gaps in your knowledge as you start to write code.

Getting close to the source

The tools that you’ll need to work with the source are as follows.

Here’s how to set up the Spring Integration source in Eclipse.

  1. Check out the source.
    svn co https://src.springframework.org/svn/spring-integration/trunk/ si
  2. Increase max perm size available to Ant.
    export ANT_OPTS="-XX:MaxPermSize=512m"
  3. Build the project. This will take approximately ten minutes while it downloads all dependencies using Ivy.

    cd si/build-spring-integration/


    If you are running on Ubuntu and at this point you get UnknownHostException error messages then see recommended fix.

  4. Import the project into eclipse.

    • File > Import > Existing projects into workspace
    • Select root directory > Browse > Select the si/ folder
    • Deselect the project with no name and click Finish
  5. Create an ivy cache variable as follows.

    • Right click on any of the projects you imported above.
    • Properties > Java Build Path > Libraries
    • Add Variable > Configure Variables > New
    • Enter variable name as ‘IVY_CACHE’ and value as something similar to /home/dhruba/sources/si/ivy-cache/repository
    • Confirm all the dialogue boxes. The projects should automatically rebuild.

At this point you should have all the Spring Integration projects imported into Eclipse with no fatal errors and at the time of writing 94 warnings. Common guys we can reduce that to zero 😉 Now you should be able to open up the org.springframework.integration.samples project and browse through and run the sample applications provided for you.

With any luck a number of further articles on Spring Integration should follow. I have a lot that I want to convey but it is, as always, finding the time and the energy to write not only the articles but fully working illustrative showcase applications.

Thanks to Jonas Partner, Spring Integration committer, for providing the instructions.

1 thought on “Spring Integration Series – Getting started”

Leave a Reply