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

Spring implementation of channels

Spring Integration defines a top-level interface for the message channel that should be implemented by any of the concrete channel implementations, as shown here:

public interface MessageChannel {
  boolean send(Message<?> message);
  boolean send(Message<?> message, long timeout);
}

The MessageChannel interface defines two versions of the send method—one which accepts only Message as an argument while the other one accepts an additional parameter (timeout). The send method returns true if the message is sent out successfully; otherwise, if it times out or the sending fails for some reason, it returns false.

Further, Spring Integration provides a sub type of the MessageChannel interface to support two types of channels: PollableChannel and SubscribableChannel. This is explained in more detail in the following points:

  • Pollable channel: This channel provides the interface that has two versions of receive, one which does not take any argument...