Book Image

Spring Integration Essentials

By : CHANDAN K PANDEY
Book Image

Spring Integration Essentials

By: CHANDAN K PANDEY

Overview of this book

Table of Contents (18 chapters)
Spring Integration Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Integration


Now is the time for actual integration! Once the router has routed the message to the appropriate endpoints, it should be processed by them. For example, it can be persisted to a database, sent on a JMS channel, or sent as an e-mail. Depending on the payload type, the router will put the message on to one of the channels jdbcChannel, jmsChannel, or mailChannel. If it cannot understand the payload, it will route it to logChannel. Let's start with the endpoint attached to the channel jdbcChannel that is used for database integration.

Database integration

In this section, we will write code to add and query data from a database. Before we write adapters from Spring Integration, let's do the basic setup.

Prerequisites

As obvious as it can be, we need a database where we can dump the data. For simplicity, we will use the in-memory database. Let's also configure the ORM provider, transaction, and other aspects to be used with the database:

  • Declaration of the embedded database:

      <jdbc...