Blogs

SpringSource Blog

Spring Integration 1.0.3 Samples: just add Maven

Mark Fisher

Spring Integration 1.0.3 is now available. You can find links to the download, reference manual, and more at the Spring Integration home. This release includes quite a few changes, but in this blog, I'm going to focus on one in particular. Starting with this version, the samples are fully self-contained and Maven-enabled. That means you can download the distribution, go into the 'samples' directory, run 'mvn install' and then import the projects into a Maven-aware Eclipse instance, such as the SpringSource Tool Suite. Here's the step-by-step breakdown…

Installing and Running the Samples

  1. Make sure you have Maven installed and in your path (2.0.9 or later is required). If not, download it and follow the setup instructions: http://maven.apache.org
  2. If you don't already have a Maven-aware version of Eclipse, you can download the SpringSource Tool Suite (STS) which will support these projects out-of-the-box (STS even includes support for the OSGi-enabled samples). Alternatively, you can manually add a Maven plugin, such as m2eclipse to an existing Eclipse installation.
  3. Download the Spring Integration Samples and unzip.
  4. Within the unzipped "samples" directory, run 'mvn install'. You should eventually see output similar to the following:
    si-samples-mvn-install-output
  5. Once STS/Eclipse is up and running, choose 'File -> Import…' and within the Wizard choose 'General -> Existing Projects into Workspace'. Then browse to the unzipped 'samples' directory, and you will see all of the projects selected by default: si-samples-import-project-list
    Either accept all or choose the individual sample(s) that you want to import, and after a few moments of workspace building, you should be ready to run.*

*NOTE: if you import the 'osgi-inbound' project, you will see some errors on that particular project (but you should not see any errors on the other projects after the workspace build completes). Those errors would be resolved after configuring the runtime and the bundle repository. If you would like to work through the OSGi samples, refer to the dedicated chapter in the Reference Manual. Also, we will be posting a blog that goes into detail on those projects within a few days.

Each of the samples has a main method within a "Demo" class (except for 'osgi-inbound' and 'osgi-outbound' which are meant to be deployed within an OSGi environment – to be covered in that upcoming blog post). For example, the 'helloworld' project has 'HelloWorldDemo'. In the javadoc of each demo class, you will find a brief overview of features showcased in that individual sample.

Enterprise Integration Patterns

For those familiar with Enterprise Integration Patterns, here is an overview of some of the patterns that are represented in each sample*:

Pattern / Sample Event Driven Consumer Polling Consumer Message Filter Message Translator Content Based Router Splitter Aggregator Channel Adapter Messaging Gateway Service Activator Request/Reply
cafe X X X X X X X X
filecopy X X X X
errorhandling X X X X
helloworld X X
jms X X X X X
oddeven X X X X X
quote X X X
ws X X X X
xml X X X X X X

*NOTE: All of the samples feature certain common patterns that are essential to the underlying Spring Integration core:

  • Message: Spring Integration Messages encapsulate a POJO payload and a header Map (Reference).
  • Message Channel: Spring Integration includes many Message Channel options for both point-to-point and publish-subscribe. Some include queues for buffering while others dispatch directly to subscribers (Reference).
  • Message Endpoint: At a high level, this includes all components that connect to channels for input and/or output.
  • Messaging Mapper: Spring Integration binds inbound Messages to method arguments and method return values to Message payloads and/or headers.
  • Message Dispatcher: In Spring Integration, channels that do not have a queue use Message Dispatchers to invoke their subscribers.
  • Pipes and Filters: This is the most general pattern describing Message-processing components connected in a loosely-coupled way via channels.
  • Message Bus: Spring Integration essentially turns a Spring ApplicationContext into a lightweight Message Bus within which all of these other components are hosted.

Next Steps

For more detailed information, check out the Samples chapter of the Reference Manual and the README file located directly in the "samples" directory of the main distribution. Also, stay tuned for another blog covering the new OSGi based samples added in Spring Integration 1.0.3. That should be posted within a few days.

Last but not least, be sure to check out the "POJO Messaging" sample from the Spring BlazeDS project (see the build and run instructions in the Spring BlazeDS Reference Manual). That demonstrates Flex Producer and Consumer elements whose "destinations" are backed by Spring Integration Message Channels.

Similar Posts

Share this Post
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Slashdot
  • Technorati
  • Twitter
 

16 responses


  1. Congrats dude!

    I wish I had the time to look into it in more detail!

    cheers,
    Alef


  2. The samples are great.

    I'm moving on to integrating Spring Integration with our app but it looks like the 1.0.3.RELEASE maven artefacts have not been loaded to maven central. I have modified our maven repo settings to access the spring maven repo and that works.

    Will the 1.0.3.RELEASE be loaded to maven central or is it now required to specifically reference the spring repo?


  3. The 1.0.3.RELEASE artifacts are in the Maven central repository:
    http://repo2.maven.org/maven2/org/springframework/integration/

    Notice the names in Maven central are different than the bundle-based names in the SpringSource repository. Each project's root directory contains a POM. For example, see:
    https://src.springframework.org/svn/spring-integration/trunk/org.springframework.integration.file/pom.xml

    Hope that helps.
    Mark


  4. Hi Mark

    I am trying to upgrade my Spring integration app to use Spring 3.0 M4. Is version 1.0.3 compatible for 3.0?

    Cheers
    Amin


  5. @Amin 1.0.3 is compatible with Spring 3.0 (that should include M4). If it isn't that's a bug.


  6. Hello Mark -

    Nice job on all front ..Looks very promising.

    Just wondering about roadmap for Monitoring side of EIP? What is the plan in Spring Integration to cover Monitoring EIP.

    Thanks.

    Regards
    -Niranjan.


  7. Is this release compatible with spring 3.0?

    Thanks,
    Joseph


  8. @Joseph, Yes version 1.0.3 does work with Spring 3.0. The "official" version for 1.0.x is still Spring 2.5.6 (in the ivy and maven configurations, etc.).

    @Niranjan, we're adding JMX Channel Adapters for the 2.0 M3 release, and we'll be building the "Control Bus" on top of that support. Stay tuned!


  9. How stable are the spring integration 2.0 Mx releases? Is it safe to go to 2.0? We would like to leverage the JMS backed channels functionality, but have stayed with 1.0.3 because it is the official release. In general, what does it mean when something is promoted to a M release (i.e, what kind of testing has been done, etc)? Any dates on when 2.0 will be released?

    Thanks guys, you are doing a awesome job.

    Joseph


  10. hi you are doing a good job


  11.  Gifts to Hyderabad, Flowers to Hyderabad, Cakes to Hyderabad,Same Day delivery all over Hyderabad
    http://www.hyderabadonlinegifts.com


  12. Hi Mark Fisher,

    i need to know the difference between Spring Integration 1.0.3 & 2.0.


  13. Hi Mark Fisher,

    i need to know the difference between Spring Integration 1.0.3 & 2.0.

    I am not able to find spring integration 2.0 Released maven artefacts. It seems they have not been loaded to maven central. I checked the below link as well
    http://repo2.maven.org/maven2/org/springframework/integration/


  14. Spring Integration 2.0 is still in the milestone phase, so you need to use our milestone repository instead. The first release candidate will be available soon, and we will be posting a blog with an overview of the new features in 2.0.

    Thanks,
    Mark


  15. Thanks Mark,

    I would like to know how can I download the src jars using maven. It will help me in debugging things on my local.


  16. Mark I would like to download the 1.0.3 release mavenized jars so please
    provide the exact maven repository.

One trackback

Leave a Reply