Spring Integration Tutorial (Intro) – Enterprise Integration Veg-O-Matic

by | Jul 10, 2014

Do you remember some of those crazy kitchen utensil commercials during the 70’s and 80’s?  One of my favorites was the Veg-O-Matic.  The slogan for that tool was that “it slices, it dices”…and of course who can forget “but wait there’s more!”

I have been working on some Enterprise application integration projects recently.  We are using the Spring Integration framework to accomplish our work.  This project within the Spring Framework portfolio amazes me.  It reminds me of the Veg-O-Matic.  It slices and dices data across the network and application spectrum like nobody’s business.  Each time I think I have seen all that the Spring Integration framework can do, I realize…”but wait there is more.”  It’s an incredibly versatile tool.

spring-integration

On-line Training – Right Here

I believe the Spring Integration project is a valuable tool worthy of inclusion in any Java developer’s toolbox.  Web mashups, cloud computing, RESTful and SOAP Web services, and big data are just some parts of  the modern application portfolio that often require moving, transforming, combining, separating, filtering, and otherwise slicing and dicing many types, sizes and shapes of data in and out of application environments.  In a space that often breeds home grown, complex and sloppy solutions, Spring Integration brings clarity and simplicity – all guided by well founded patterns.  If you haven’t yet had a chance to learn Spring Integration, you are in luck.  Over the coming weeks, I’ll use this blog site as a forum to bring you hands-on Spring Integration training.

What is Enterprise Application Integration

Before we begin talking about Spring Integration, let’s make sure you understand the term Enterprise Application Integration (EAI).  EAI is the middleware that allows applications across an Enterprise to communicate and work together.  Gartner Group is credited with defining EAI as “unrestricted sharing of data and business processes among any connected application or data sources in the enterprise.”  Admittedly, EAI can sound like many things and seem like a nebulous term, but that is the reality of the situation.

EAI is anything that allows applications to work together and share data and processes.  While not always the case, the applications share data and processes that they probably weren’t originally designed to share and in ways that may not have even have been conceivable at the time of their creation.  Often, the applications run on different boxes, atop different operating systems, and distributed across the network (maybe even the Internet).  The applications may have data stored and organized in very different forms.  The applications may have been written in different programming languages.

Enterprise Integration Patterns

While it might seem that EAI defines a disparate field of middleware software, it turns out that there are some pretty common and well understood needs within this space.  For example, applications that need to communicate with each other, often speak in different data formats and there is a need to transform the data from one application format to another.  My application uses and speaks XML while your application uses and speaks JSON.  Before you can communicate with and make use of the services and data that my application provides, the EAI solution has to transform my data to JSON for your application to understand.

There are even well known solutions to many of the common needs in the EAI world.  When you have a common solution to a commonly occurring problem you have what we call a design pattern.  Within EAI, there is a relatively famous and well known collection of design patterns.  They are the Enterprise Integration Patterns as defined by Gregor Hohpe and Bobby Woolf in their book by the same name:  Enterprise Integration Patterns (Addison-Wesley, 2003).  Hohpe and Woolf are to EAI design patterns what Gamma et. al are to general design patterns.

eipbookcover

In fact Hohpe and Woolf not only documented the design patterns around EAI, they also developed an EAI vocabulary and graphical notation to be able to more easily discuss, document and design EAI applications.  If you are into EAI, Hohpe and Woolf are the “rock stars” of the community and a must read.

Spring Integration (SI) is EIP Built on Spring Framework Foundation

Why are the Enterprise Integration Patterns (EIP) important to the discussion about Spring Integration framework?  Because Spring Integration is physical embodiment of the EIP  in Java and on top of the Spring Framework.  As the Spring Integration documentation states:  “Developers who have read that book should be immediately comfortable with the Spring Integration concepts and terminology.”  Spring Integration provides a lego-like collection of EIP building blocks that allow you to build your EAI solutions in a easy to think about, easy to assemble fashion.

Of course, Spring Integration is also built on top of the Spring Framework.  This allows you to leverage the dependency injected, loosely coupled, easily extended, POJO driven capabilities of Spring in your EAI solution and even incorporate other Spring technologies (AOP, security, etc.) where necessary.

Learning Spring Integration

So what do you need know in order to learn Spring Integration?  Prerequisites for learning Spring Integration and following along with the rest of my on-line training series include knowing Java and the basics of the Spring Framework.  Specifically with regard to knowing Spring, you need to understand Spring containers, dependency injection, and how to define and wire Spring beans by XML and annotations.  Knowledge or at least familiarity with Enterprise Integration Patterns is helpful, but not required (however by the end of the training, you will know many of the EIP if you don’t already know them).

What do you need to run the exercises that will be provided with this on-line class?  All the labs will be written in downloadable Eclipse projects.  So if you have a recent version of Java (Java 8, but Java 6 or 7 is fine), and Eclipse (I am using the Kepler train release but any Eclipse 4 or better version of Eclipse will do) you are ready.  The contents of the training will look at Spring Integration 4 (and therefore also use Spring Framework version 4 at its base.

In the training, we are going to look at many of the common components (and Enterprise integration patterns) you find in EAI solutions.  Specifically, we will look at Spring Integration’s

  • Message Channels
  • Adapters
  • Gateways
  • Filters
  • Transformers
  • Enrichers
  • Service Activators
  • Routers

Spring Integration is a big project and there is no way to cover it all.  The training should give you enough to get a sense of SI’s power and capabilities while helping you see a place for it in your projects.

 

Check out the other parts of the tutorial series using the links below.