Spring integration in action

367 146 0
Spring integration in action

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

MANNING IN ACTION Mark Fisher Jonas Partner Marius Bogoevici Iwein Fuld FOREWORD BY Rod Johnson www.it-ebooks.info Spring Integration in Action www.it-ebooks.info www.it-ebooks.info Spring Integration in Action MARK FISHER JONAS PARTNER MARIUS BOGOEVICI IWEIN FULD MANNING SHELTER ISLAND www.it-ebooks.info For online information and ordering of this and other Manning books, please visit www.manning.com The publisher offers discounts on this book when ordered in quantity For more information, please contact Special Sales Department Manning Publications Co 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: orders@manning.com ©2012 by Manning Publications Co All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine Manning Publications Co 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Development editor: Copyeditor: Technical proofreaders: Proofreader: Typesetter: Cover designer: Cynthia Kane Benjamin Berg Neale Upstone, Doug Warren Katie Tennant Dottie Marsico Marija Tudor ISBN 9781935182436 Printed in the United States of America 10 – MAL – 17 16 15 14 13 12 www.it-ebooks.info brief contents PART BACKGROUND .1 ■ Introduction to Spring Integration ■ Enterprise integration fundamentals 24 PART MESSAGING 43 ■ Messages and channels 45 ■ Message Endpoints ■ Getting down to business 80 ■ Go beyond sequential processing: routing and filtering 104 ■ Splitting and aggregating messages 63 122 PART INTEGRATING SYSTEMS 139 ■ Handling messages with XML payloads 141 ■ Spring Integration and the Java Message Service 155 10 ■ Email-based integration 11 ■ Filesystem integration 12 ■ Spring Integration and web services 13 ■ Chatting and tweeting 219 180 191 v www.it-ebooks.info 208 vi BRIEF CONTENTS PART ADVANCED TOPICS .237 14 ■ Monitoring and management 15 ■ 239 Managing scheduling and concurrency 16 ■ Batch applications and enterprise integration 276 17 ■ Scaling messaging applications with OSGi 292 18 ■ Testing 304 www.it-ebooks.info 258 contents foreword xv preface xvii acknowledgments xix about this book xxii author online xxvii about the authors xxviii about the cover illustration xxix PART 1 BACKGROUND Introduction to Spring Integration 1.1 1.2 Spring Integration’s architecture Spring Integration’s support for enterprise integration patterns Messages 1.3 ■ Message Channels Message endpoints 10 Enterprise integration patterns meet Inversion of Control 13 Dependency injection 1.4 1.5 ■ 13 ■ Method invocation Say hello to Spring Integration Summary 22 vii www.it-ebooks.info 19 16 viii CONTENTS Enterprise integration fundamentals 24 2.1 Loose coupling and event-driven architecture 25 Why should you care about loose coupling? 25 Type-level coupling 27 Loosening type-level coupling with dependency injection 28 System-level coupling 30 Event-driven architecture 32 ■ ■ ■ 2.2 ■ Synchronous and asynchronous communication What’s the difference? fit in? 36 2.3 33 32 Where does Spring Integration ■ Comparing enterprise integration styles 38 Integrating applications by transferring files 39 Interacting through a shared database 39 Exposing a remote API through Remote Procedure Calls 40 Exchanging messages 41 ■ ■ ■ 2.4 PART Summary 41 MESSAGING .43 Messages and channels 3.1 45 Introducing Spring Integration messages 46 What’s in a message? Integration 47 3.2 46 ■ How it’s done in Spring Introducing Spring Integration channels 49 Using channels to move messages 50 I’ll let you know when I’ve got something! 50 Do you have any messages for me? 50 The right channel for the job 51 A channel selection example 53 ■ ■ ■ 3.3 Channel collaborators 57 MessageDispatcher 3.4 Summary 57 ■ ChannelInterceptor 59 62 Message Endpoints 63 4.1 What can you expect of an endpoint? 65 To poll or not to poll? 66 Inbound endpoints 67 Outbound endpoints 68 Unidirectional and bidirectional endpoints 69 ■ ■ ■ 4.2 Transaction boundaries around endpoints 70 Why sharing isn’t always a good thing 70 What are transactions, and can we get by without them? 71 ■ www.it-ebooks.info ix CONTENTS 4.3 4.4 Under the hood 74 Endpoint parsing 75 Summary Endpoint instantiation 76 78 Getting down to business 5.1 ■ 80 Domain-driven transformation 81 Marshalling flight information 82 Using the simplest possible data representation 84 Wiring the components together 86 Testing the transformer 88 Content enricher 90 Header enricher 91 ■ ■ ■ 5.2 Message-driven services 94 The Service Activator pattern pattern 94 5.3 5.4 5.5 5.6 ■ 94 ■ The Return Address Message publishing interceptors 96 Domain-driven Messaging Gateways 97 Chaining endpoints 100 Summary 102 Go beyond sequential processing: routing and filtering 104 6.1 Do you want to get this message? 105 Filtering out messages processing 109 6.2 105 ■ Using filters for selective Whose message is this, anyway? 110 Configuring routers 111 Routers provided by the framework 114 Routers with multiple destinations 117 ■ ■ 6.3 Under the hood 119 The message filter API 119 6.4 Summary ■ The message router API 120 121 Splitting and aggregating messages 122 7.1 Introducing correlation 123 A real-life example 7.2 124 ■ Correlating messages Splitting, aggregating, and resequencing 125 126 The art of dividing: the splitter 126 How to get the big picture: the aggregator 127 Doing things in the right order: the resequencer 128 ■ ■ www.it-ebooks.info .. .Spring Integration in Action www.it-ebooks.info www.it-ebooks.info Spring Integration in Action MARK FISHER JONAS PARTNER MARIUS BOGOEVICI IWEIN FULD MANNING SHELTER ISLAND www.it-ebooks.info... Spring Integration 1.1 1.2 Spring Integration s architecture Spring Integration s support for enterprise integration patterns Messages 1.3 ■ Message Channels Message endpoints 10 Enterprise integration. .. example 279 ■ ■ 16.2 Introducing Spring Batch 281 A batch job in five minutes 16.3 281 ■ Getting the job done 284 Integrating Spring Batch and Spring Integration 285 Launching batch jobs through

Ngày đăng: 19/04/2019, 16:43

Từ khóa liên quan

Mục lục

  • SpringIntegrationInAction

  • brief contents

  • contents

  • foreword

  • preface

  • acknowledgments

  • about this book

    • Roadmap

    • Who should read this book?

    • Code conventions and downloads

    • Author Online

    • about the authors

    • about the cover illustration

    • Part 1 Background

      • 1 Introduction to Spring Integration

        • 1.1 Spring Integration’s architecture

        • 1.2 Spring Integration’s support for enterprise integration patterns

          • 1.2.1 Messages

          • 1.2.2 Message Channels

          • 1.2.3 Message endpoints

          • 1.3 Enterprise integration patterns meet Inversion of Control

            • 1.3.1 Dependency injection

            • 1.3.2 Method invocation

            • 1.4 Say hello to Spring Integration

            • 1.5 Summary

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan