Introduction

The majority of the open source Java frameworks have focused on supporting database-backed web sites. Developers have leveraged these frameworks to create highly scalable and performant vertical applications using projects such as Spring and Hibernate. Recently, a number of frameworks have been developed with the purpose of solving the horizontal problem of integrating data and services between disparate applications across the enterprise. Spring Integration is one of these solutions.

Enterprise integration is an architectural approach for integrating disparate services and data in software. Enterprise integration seeks to simplify and automate business processes without requiring comprehensive changes to the existing applications and data structures. Spring Integration is an extension of Spring’s Plain Old Java Object (POJO) programming model to support the standard integration patterns while building on the Spring Framework’s existing support for integration with systems and users.

The Spring Framework is the most widely used framework in organizations today. Spring Integration works in terms of the fundamental idioms of integration, including messages, channels, and endpoints. It enables messaging within Spring-based applications and integrates with external systems via Spring Integration’s adapter framework. The adapter framework provides a higher level of abstraction over Spring’s existing support for remote method invocation, messaging, scheduling, and much more. Developers already familiar with the Spring Framework will find Spring Integration easy to pick up, since it uses the same development model and idioms.

This book will cover the vast world of enterprise application integration, as well as the application of the Spring Integration framework toward solving integration problems. The book can be summed up as the following:

  • An introduction to the concepts of enterprise application integration.
  • A reference on building event-driven applications using Spring Integration.
  • A guide to solving common integration problems using Spring Integration.

Who This Book Is For

This book is for any developer looking for a more natural way to build event-driven applications using familiar Spring idioms and techniques. The book is also for architects seeking to better their applications and increase productivity in their developers. You should have a basic understanding of the Java language. A familiarity with the Spring Framework and messaging are useful, but not required, as we provide an introduction to those concepts.

How This Book Is Structured

To give you a quick idea of what this book covers, here’s a brief chapter-by-chapter overview:

  • Chapter 1 provides an introduction to enterprise application integration—an architectural approach for integrating disparate services and data in software.
  • Chapter 2 takes a look as some of the alternative open source technologies for enterprise integration.
  • Chapter 3 introduces the Spring Framework and provides a glance at some of the major modules leveraged by Spring Integration.
  • Chapter 4 introduces several of the enterprise APIs supported by the core Spring Framework, including those for JDBC, object-relationship management, transactions, and remoting.
  • Chapter 5 introduces the basic Spring Integration components and how they extend the Spring Framework into the world of messaging and event-driven architectures.
  • Chapter 6 introduces the concept of a message channel and how the Spring Integration framework simplifies the development of message channels in an integration implementation.
  • Chapter 7 covers transformations, which allow the message payload to be modified to the format and structure required by the downstream endpoint. It also covers enrichment, which allows for augmenting and modifying the message header values as required for supporting downstream message handling and endpoint requirements.
  • Chapter 8 covers the different components available for controlling message flow in Spring Integration, and how to use a workflow engine with Spring Integration.
  • Chapter 9 focuses on endpoints that connect to the message channels, application code, external applications, and services.
  • Chapter 10 introduces the support for management and monitoring provided by Spring Integration and other available open source systems.
  • Chapter 11 discusses the Spring Integration channel adapters used to communicate with files, sockets, streams, file servers, and databases.
  • Chapter 12 focuses on enterprise messaging using transports such as Java Message Service (JMS) and the Advanced Message Queuing Protocol (AMQP).
  • Chapter 13 discusses the Spring Integration adapters that support integrating with e-mail, XMPP (Jabber, GTalk, Facebook Chat, etc.), news feeds (RSS, ATOM, etc.), and Twitter.
  • Chapter 14 covers how Spring Integration provides both client and server support for web services and how to integrate web services with the Spring Integration messaging framework.
  • Chapter 15 explores the support offered in the core Spring Integration framework to help you build your own adapters.
  • Chapter 16 focuses on how to increase performance by scaling out the hardware and how Spring Integration applications can take advantage of concurrency.
  • Chapter 17 reviews the Spring Batch project and how it can be used with Spring Integration.
  • Chapter 18 shows how Spring Integration can be used to create a basic web interface with the HTTP inbound and outbound gateways. It also discusses the Spring Integration support for the server pushing data to the client browser.

Conventions

Sometimes when we want you to pay particular attention to a part within a code example, we will make the font bold. Please note that the bold does not necessarily reflect a code change from the last version. In cases when a code line is too long to fit the page’s width, we break it with a code continuation character, which looks like this: image. Please note that when you type out the code, you have to concatenate the line by yourself without any spaces.

Prerequisites

Because the Java programming language is platform independent, you are free to choose any supported operating system. However, some of the examples in this book use platform-specific paths. Translate them as necessary to your operating system’s format before typing out the examples. To make the most of this book, install JDK version 1.5 or higher. You should have a Java IDE installed to make development easier. For this book, the sample code is Maven based. If you’re running Eclipse and you install the m2eclipse plug-in, you can open the same code in Eclipse, and the class path and dependencies will be filled in the by the Maven metadata. If you’re using Eclipse, you might prefer SpringSource’s free SpringSource Tool Suite (STS) (www.springsource.com/developer/sts), which comes preloaded with all the plug-ins you will need to be as efficient as possible with the Spring Framework.

If you use NetBeans or IntelliJ IDEA, there are no special configuration requirements: they already support Maven out of the box and also provide some support for Spring.

This book uses Maven (2.2.1 or higher). The recommended approach is to simply use a tool like Maven, Ant, Ivy, or Gradle to handle dependency management. The Maven dependency coordinates given in this book can also be used with Ivy, Gradle, and others.

Downloading the Code

The source code for this book is available from the Apress web site (www.apress.com), in the Source Code section. The source code is organized by chapters, each of which includes one or more independent examples. Note that there are four Spring Integration sandbox projects used in this book. Sandbox projects tend to be a moving target and we will do our best to keep the information up to date at the Apress web site for any changes required to build these projects. More information about build the sandbox project may be found in the readme.txt file within the source code.

Contacting the Authors

We always welcome your questions and feedback regarding the content of this book. You can reach Mark Lui via his blog at http://drmarklui.wordpress.com, or via e-mail at [email protected]. Mario Gray can be contacted through his blog at http://www.sudoinit5.com, or by e-mail at [email protected]. Andy Chan can be reached via Twitter (@iceycake) or his blog site, http://www.iceycake.com. Josh Long can be reached at his blog at http://www.joshlong.com, by e-mail at [email protected], or on Twitter (@starbuxman).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.218.45