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

Selecting a channel

Let's discuss what default implementations have been provided by Spring Integration and how they can be leveraged.

Publish-subscribe channel

This is the only implementation of the publish-subscribe model of channel. The primary purpose of this channel is to send messages to registered endpoints; this cannot be polled. It can be declared as follows:

<int:publish-subscribe-channel id="pubSubChannel"/>

Let's discuss each of the elements in this line; this will be used throughout the examples of this chapter:

  • int: This is a namespace that declares all Spring Integration components. As discussed in Chapter 1, Getting Started, the STS visual editor can be used to add different namespaces from Spring Integration.
  • publish-subscribe-channel: This is the type exposed by Spring.
  • Id: This is the unique name through which the channel can be referred.

To refer to these elements from the code, we can use:

public class PubSubExample {
  private ApplicationContext ctx...