Book Image

Spring Integration Essentials

By : CHANDAN K PANDEY
Book Image

Spring Integration Essentials

By: CHANDAN K PANDEY

Overview of this book

This book is intended for developers who are either already involved with enterprise integration or planning to venture into the domain. Basic knowledge of Java and Spring is expected. For newer users, this book can be used to understand an integration scenario, what the challenges are, and how Spring Integration can be used to solve it. Prior experience of Spring Integration is not expected as this book will walk you through all the code examples.
Table of Contents (12 chapters)
11
Index

Gateways

Abstraction and loose coupling is always desired. Messaging gateways is a mechanism to publish a contract that can be used by systems without exposing the underlying messaging implementation. For example, a gateway for a mailing subsystem can expose methods for sending and receiving mail. Internally, the implementation can be done using the raw Java mail API, or can be adapters from Spring Integration, or may be some custom implementation altogether. As long as the contract does not change, implementation can be easily switched or enhanced without impacting on the rest of the modules. It is an implementation of more generic gateway patterns. Gateways can be of two types: synchronous and asynchronous.

Synchronous gateways

Let's quickly see what a declaration of a gateway looks like in Spring Integration, and then decimate it further to build our understanding:

<int:gateway id="feedService" 
  service-interface="com.cpandey.siexample.service.FeedService"...