You are previewing Spring Integration Essentials.
O'Reilly logo
Spring Integration Essentials

Book Description

Integrate the heterogeneous endpoints of enterprise applications with Spring Integration for effective communication

In Detail

This book begins with an introduction to the enterprise integration landscape, the challenges, the approaches that have been tried, and how Spring Integration can help address these issues. You will learn how to deal with enterprise integration challenges such as the heterogeneous communication format, data transfer, transformation, external system invocation, security or transaction propagation, and more. You will also see how each of these layers can be addressed by a specific set of Spring Integration components.

You will explore each Spring Integration component in the context of the enterprise integration problem that it tries to address by covering the theory, writing code snippets, and doing real integration.

By the end, you will not only be able to identify and design enterprise communication, but you will also be able to code it using Spring Integration.

What You Will Learn

  • Set up your Spring tool suite IDE to get the best support possible for Spring Integration

  • Discover how messages can be consumed from external sources

  • Understand the different ways in which a message can be processed once it is inside the system

  • Transform messages from one format to another

  • Orchestrate message flow across endpoints

  • Use Spring Integration components to connect to external systems such as databases, FTP servers, social networking sites, and process batch jobs

  • Test and scale up your Spring Integration application to monitor and manage its performance

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Spring Integration Essentials
      1. Table of Contents
      2. Spring Integration Essentials
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      8. Preface
        1. How enterprise integration challenges can be solved
        2. Who are the players?
        3. Why Spring Integration?
        4. What this book covers
        5. What you need for this book
        6. Who this book is for
        7. Conventions
        8. Reader feedback
        9. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      9. 1. Getting Started
        1. Setting up STS
        2. Creating your first project
        3. STS visual editor
        4. Spring Integration Scala DSL
        5. Summary
      10. 2. Message Ingestion
        1. Working with message channels
        2. Channel types
        3. Spring implementation of channels
        4. Selecting a channel
          1. Publish-subscribe channel
          2. Queue channel
          3. Priority channel
          4. Rendezvous channel
          5. Direct channel
          6. Executor channel
          7. Scoped channel
          8. Datatype channel
        5. Error handling on channels
        6. Persisting and recovering channels
        7. Channel interceptors
        8. Summary
      11. 3. Message Processing
        1. Message endpoints
        2. Gateways
          1. Synchronous gateways
          2. Asynchronous gateways
        3. Service activators
        4. Delayers
        5. Transactions
        6. Summary
      12. 4. Message Transformers
        1. Introducing message transformers
        2. Working with XML payload
          1. The marshalling transformer
          2. The unmarshalling transformer
          3. XPath transformers
        3. Validating XML messages
        4. Beyond default transformers
        5. Content enrichers
          1. Header enrichers
          2. Payload enrichers
        6. Claim check
          1. Incoming claim check transformer
          2. Outgoing claim check transformer
        7. Summary
      13. 5. Message Flow
        1. Routers
          1. Payload-type router
          2. Header value router
          3. Recipient list router
          4. XPath router
          5. Error message exception-type router
          6. Default output channel
        2. Using annotations
        3. Filters
          1. Using a Java class to act as a filter
          2. Configuring a filter as a message endpoint
        4. Splitters
        5. Aggregators
          1. Correlation strategy
          2. Release strategy
          3. Message store
        6. Resequencers
        7. Chaining handlers
        8. Summary
      14. 6. Integration with External Systems
        1. Working with files
          1. Prerequisites
          2. Reading files
            1. Behind the scenes
            2. Filters
            3. Preventing duplicates
            4. Concurrent access
          3. Writing files
            1. Naming the file
            2. Target directory
            3. Dealing with existing filenames
            4. File transformers
        2. FTP/FTPS
          1. Prerequisites
          2. Downloading files from the FTP server
            1. Incomplete files
          3. Uploading files to the FTP server
            1. Avoiding partially written files
          4. FTP outbound gateway
          5. FTPS support
        3. Social integration
          1. Prerequisites
          2. Receiving tweets
          3. Sending tweets
          4. Twitter search outbound gateway
        4. Enterprise messaging
          1. Prerequisites
          2. Receiving messages – the inbound adapter
            1. The polling adapter
            2. The event-driven adapter
          3. Sending messages – the outbound adapter
          4. Gateway
            1. The inbound gateway
            2. The outbound gateway
        5. HTTP
          1. Prerequisites
          2. The HTTP inbound gateway
          3. The HTTP outbound gateway
        6. Web services
          1. Prerequisites
          2. The inbound gateway
          3. The outbound gateway
        7. Database SQL
          1. Prerequisites
            1. Datasource
          2. Reading from the database – the inbound adapter
            1. Transaction support
          3. Writing to the database – the outbound adapter
          4. Inbound and outbound gateways
        8. Stream processing
          1. Prerequisites
          2. Reading from a stream
          3. Writing to a stream
        9. Summary
      15. 7. Integration with Spring Batch
        1. Spring Batch
          1. Prerequisites
        2. Defining a Spring Batch job
          1. The Spring Batch job language
          2. ItemReader
          3. ItemWriter
        3. Spring Batch and Spring Integration
          1. Launching the job
          2. Tracking the status of a batch job
          3. The other way round
        4. Summary
      16. 8. Testing Support
        1. Prerequisite
        2. Testing messages
        3. Testing headers
        4. Handling errors
        5. Testing filters
        6. Splitter test
        7. Summary
      17. 9. Monitoring, Management, and Scaling Up
        1. Monitoring and management
          1. JMX support
            1. Prerequisites
            2. The notification listening channel adapter
            3. The notification publishing channel adapter
            4. The attribute polling channel adapter
            5. The tree polling channel adapter
            6. The operation invoking channel adapter
            7. The operation invoking outbound gateway
            8. The MBean exporter
          2. Tracking the message
          3. Wire tap
          4. Control bus
        2. Scaling up
          1. Threading
          2. Scaling the state
            1. Message store
            2. Claim check
        3. Summary
      18. 10. An End-to-End Example
        1. Prerequisites
          1. Setting up
        2. Ingesting data
          1. Ingesting data from the RSS feed
          2. Ingesting data from an FTP server
          3. Filtering the data
        3. The aggregator
          1. The correlation bean
          2. The completion bean
          3. The aggregator bean
        4. The splitter
        5. Transformation
          1. The DB transformer
          2. The JMS transformer
          3. The mail transformer
        6. Router
        7. Integration
          1. Database integration
            1. Prerequisites
            2. The gateway
            3. The service activator
            4. Gateways for updating and reading the feeds
          2. Sending a mail
          3. Putting messages on to the JMS queue
        8. Exporting as an MBean
        9. Summary
      19. Index