ebook img

Just Spring Integration PDF

98 Pages·2012·4.289 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Just Spring Integration

Just Spring Integration Madhusudhan Konda Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Just Spring Integration by Madhusudhan Konda Copyright © 2012 Madhusudhan Konda. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editors: Mike Loukides and Meghan Blanchette Cover Designer: Karen Montgomery Production Editor: Rachel Steely Interior Designer: David Futato Copyeditor: Chet Chin Illustrators: Robert Romano and Rebecca Demarest Proofreader: Rachel Steely Revision History for the First Edition: 2012-03-30 First release See http://oreilly.com/catalog/errata.csp?isbn=9781449316082 for release details. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Just Spring Integration, the image of a long-eared jerboa, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-31608-2 [LSI] 1333127337 Table of Contents Foreword ................................................................... vii Preface ..................................................................... ix 1. Integration Fundamentals ............................................... 1 Introduction 1 Integration Strategies 1 Messaging Patterns 2 Traditional Programming Model 3 Standalone Messaging Model 5 Summary 7 2. Basics ................................................................. 9 Introduction 9 Messages 9 Dissecting a Message 9 Generic Implementation 10 Message Channels 11 Declaring Channels 12 Endpoints 12 Service Activator Endpoint Example 12 Example 13 Summary 15 3. Message Channels ..................................................... 17 Introduction 17 Message Channels 17 Receiving Messages 18 Queue Channel 21 Priority Channel 22 Rendezvous Channel 23 iii PublishSubscribe Channel 24 Direct Channel 25 Executor Channel 26 Null Channel 26 Summary 27 4. Endpoints ............................................................ 29 Introduction 29 Common Endpoints 29 Service Activator 30 Message Bridge 31 Message Enricher 32 Gateway 34 Delayer 37 Spring Expressions 37 Scripting Support 38 For the Curious: Endpoint API 38 Consumers 39 Summary 42 5. Transformers .......................................................... 43 Introduction 43 Built-In Transformers 43 String Transformers 43 Map Transformers 44 Serializing and Deserializing Transformers 44 JSON Transformers 45 XML Transformers 46 XPath Transformers 47 Custom Transformers 48 Trade Map Transformer 48 String Transformer 49 Using Annotations 50 Summary 51 6. Flow Components ...................................................... 53 Introduction 53 Filters 53 Using Custom Filters 54 Using Framework’s MessageSelector 55 Using Annotations 55 Discarded Messages 56 Routers 57 iv | Table of Contents PayloadTypeRouter 57 HeaderValueRouter 58 Custom Routers 58 Recipient List Router 59 Unqualified Messages 59 Routers Using Annotations 59 Splitters 60 Using Custom Splitters 60 Using AbstractMessageSplitter 62 Using Annotations 62 Splitter in the Background 63 Aggregators 64 Strategies 64 Correlation Strategy 65 Release Strategy 66 Message Store 67 Resequencers 67 Summary 68 7. Adapters ............................................................. 69 Introduction 69 File Adapters 69 Using Namespace 70 Standalone File Readers 72 Outbound Adapters 73 Standalone File Adapters 74 FTP Adapters 74 Session Factory 74 Inbound FTP Adapters 75 Outbound FTP Adapters 76 JMS Adapters 76 Inbound Adapters: Receiving Messages 77 Publishing Messages: Outbound Adapters 79 JDBC Adapters 79 Inbound JDBC Adapters 79 Outbound JDBC Adapters 80 Summary 81 Table of Contents | v Foreword It’s a tough challenge to find the right depth and the right level of abstraction when introducing a new technology. A book can go too deep, and risk miring the reader in technological minutiae. This is hardly helpful, and—more often than not—it’s boring. A book can also stay at a very abstract level, and revel in theory, but even this is boring and useless for someone who hopes to achieve anything useful. Instead, the best books treat a new technology as a dark room. They hold your hand and introduce the concepts as you’re likely to encounter them, while saving you from missteps that you might otherwise make. This is one such book: it introduces the concepts of Spring Integra- tion’s API, along with their designs, but lets you move onto the next subject and keep the entire mental map of the room in your head. If you’re new to integration, and new to Spring Integration in particular, then let Madhusudhan Konda hold your hand and lead you to the light ahead, in this easy-to- read guide, Just Spring Integration. When you’re done, you’ll be up and running, and if you still need more details, then you can always consult the Spring Integration project page for in-depth features and access to the forums. —Josh Long vii

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.