Trivadis Integration Blueprint V0.1

Similar documents
SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version

Geodatabase Best Practices. Dave Crawford Erik Hoel

Bentley Map Advancing GIS for the World s Infrastructure

Outline F eria AADL behavior 1/ 78

Introduction to ArcGIS Server Development

UML. Design Principles.

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering

Troubleshooting Replication and Geodata Service Issues

Time. Today. l Physical clocks l Logical clocks

Enabling ENVI. ArcGIS for Server

Inter-Reactive Kotlin Applications

High Performance Computing

Outline. PeerSim: Informal introduction. Resources. What is PeerSim? Alberto Montresor Gianluca Ciccarelli

Distributed Systems Principles and Paradigms. Chapter 06: Synchronization

Integration of ArcFM UT with SCADA, SAP, MAXIMO and Network Calculation

Scheduling I. Today Introduction to scheduling Classical algorithms. Next Time Advanced topics on scheduling

Cuts. Cuts. Consistent cuts and consistent global states. Global states and cuts. A cut C is a subset of the global history of H

CS 347 Parallel and Distributed Data Processing

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

INF Models of concurrency

Socket Programming. Daniel Zappala. CS 360 Internet Programming Brigham Young University

GENERALIZATION IN THE NEW GENERATION OF GIS. Dan Lee ESRI, Inc. 380 New York Street Redlands, CA USA Fax:

AstroPortal: A Science Gateway for Large-scale Astronomy Data Analysis

Leveraging Web GIS: An Introduction to the ArcGIS portal

Scheduling Slack Time in Fixed Priority Pre-emptive Systems

Distributed Algorithms Time, clocks and the ordering of events

Actors for Reactive Programming. Actors Origins

Android Services. Lecture 4. Operating Systems Practical. 26 October 2016

Distributed Systems Principles and Paradigms

CHAPTER 22 GEOGRAPHIC INFORMATION SYSTEMS

Portal for ArcGIS: An Introduction. Catherine Hynes and Derek Law

Esri UC2013. Technical Workshop.

Using OGC standards to improve the common

From BASIS DD to Barista Application in Five Easy Steps

Lists, Stacks, and Queues (plus Priority Queues)

From BASIS DD to Barista Application in Five Easy Steps

Scheduling I. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Advanced topics on scheduling

Performing Map Cartography. using Esri Production Mapping

Portals: Standards in Action

Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application

Time. To do. q Physical clocks q Logical clocks

Distributed Architectures

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No!

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

Data Aggregation with InfraWorks and ArcGIS for Visualization, Analysis, and Planning

Lab Course: distributed data analytics

Chain of Responsibility

Slides for Chapter 14: Time and Global States

Andrew Morton University of Waterloo Canada

ArcGIS Deployment Pattern. Azlina Mahad

Agreement. Today. l Coordination and agreement in group communication. l Consensus

Geodatabase: Best Practices. Robert LeClair, Senior Instructor

Energy-Efficient Broadcast Scheduling. Speed-Controlled Transmission Channels

CWMS Modeling for Real-Time Water Management

Time, Clocks, and the Ordering of Events in a Distributed System

CPSC 531: System Modeling and Simulation. Carey Williamson Department of Computer Science University of Calgary Fall 2017

Multicore Semantics and Programming

IMPACT Improving Massachusetts Post-Acute Care Transfers

Portal for ArcGIS: An Introduction

Design Patterns and Refactoring

Discrete Event Simulation. Motive

CS 3411 Systems Programming

Concurrent Models of Computation

Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms. CS 249 Project Fall 2005 Wing Wong

Description of the ED library Basic Atoms

Performance Evaluation of the Matlab PCT for Parallel Implementations of Nonnegative Tensor Factorization

Crime Analyst Extension. Christine Charles

Modern Functional Programming and Actors With Scala and Akka

rethinking software design by analyzing state

Time is an important issue in DS

Atmospheric Science and GIS Interoperability issues: some Data Model and Computational Interface aspects

2007 IEEE. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes

Absence of Global Clock

Eindhoven University of Technology MASTER. Student SOA lab. Leijten, P.J.M. Award date: 2008

AstroPortal: A Science Gateway for Large-scale Astronomy Data Analysis

Geologi for samfunnet

Solutions to COMP9334 Week 8 Sample Problems

NEC PerforCache. Influence on M-Series Disk Array Behavior and Performance. Version 1.0

Telecommunication Services Engineering (TSE) Lab. Chapter IX Presence Applications and Services.

Modeling Management Metrics for Monitoring Software Systems

Discovery and Access of Geospatial Resources using the Geoportal Extension. Marten Hogeweg Geoportal Extension Product Manager

Realizability of Interactions in Collaboration Diagrams

Demaq: A Foundation for Declarative XML Message Processing

A Utilization Bound for Aperiodic Tasks and Priority Driven Scheduling

Lecture 4: Process Management

EDF Feasibility and Hardware Accelerators

Recursive InterNetworking Architecture (RINA) Boston University Prototype Programming Manual (version 1.0)

ArcGIS Enterprise: What s New. Philip Heede Shannon Kalisky Melanie Summers Sam Williamson

Innovation. The Push and Pull at ESRI. September Kevin Daugherty Cadastral/Land Records Industry Solutions Manager

CSE 380 Computer Operating Systems

SOFTWARE ARCHITECTURE DESIGN OF GIS WEB SERVICE AGGREGATION BASED ON SERVICE GROUP

FIS' Partnership with Zelle for P2P Payments

An object-oriented design process. Weather system description. Layered architecture. Process stages. System context and models of use

ArcGIS Pro Q&A Session. NWGIS Conference, October 11, 2017 With John Sharrard, Esri GIS Solutions Engineer

Troubleshooting Replication and Geodata Services. Liz Parrish & Ben Lin

The conceptual view. by Gerrit Muller University of Southeast Norway-NISE

Geoprovisioning delivers geodata and its analysis for specific areas on request.

USEPA's Comprehensive Geospatial Information Sharing Framework

ArcGIS Enterprise: What s New. Philip Heede Shannon Kalisky Melanie Summers Shreyas Shinde

CIS 4930/6930: Principles of Cyber-Physical Systems

Transcription:

Spring Integration Peter Welkenbach Principal Consultant peter.welkenbach@trivadis.com Agenda Integration Blueprint Enterprise Integration Patterns Spring Integration Goals Main Components Architectures and other things Conclusion Basel Baden Bern Lausanne Zürich Düsseldorf Frankfurt/M. Freiburg i. Br. Hamburg München Stuttgart Wien 2 EAI Patterns (Hohpe, Woolf 2004) Integration - Flow 3

Agenda Enterprise Integration Patterns Spring Integration Goals Main Components Architectures and other things Integration Blueprint Conclusion 6 Spring Integration Goals Spring Integration is motivated by the following goals Provide a simple model for implementing complex enterprise integration solutions Facilitate asynchronous, parallel, message-driven behavior within a Spring-based application Simple programming model to allow easy utilization of multicore processors and multiprocessor hardware Patterns Layers enforce separation of cooncerns Interface contracts promote Loose coupling Pipes decouple components Filter = Service, Router, or transformer Channel adapeters connect in/out-bound transports 7 8

Super layering, Well Done!! Agenda Integration Blueprint Enterprise Integration Patterns Spring Integration Goals Main Components Architectures and other things Conclusion 10 Message p u b l i c i n t e r f a c e M e s s a g e < T > { O b j e c t g e t I d ( ) ; M e s s a g e H e a d e r g e t H e a d e r ( ) ; Message Channel A generic container for any Java object + metadata Payload of any type Header = Metadata (e.g. timestamp, expiration, return address,..) Developers can also store any arbitrary keyvalue properties or attributes in the header. T g e t P a y l o a d ( ) ; b o o l e a n i s E x p i r e d ( ) ; Decouples producers from consumers Enforces data type consistency Provides a subscription strategy Point-to-Point Channel, Publish/Subscribe Channel Enables message-based error handling Invalid Message Channel, Dead Message Channel 11 12

Channel implementation The S i m p l e C h a n n e l implementation wraps a queue FIFO capacity = 0: "direct-handoff" channel where a sender will block until the channel's receive() method is called capacity > 0: channel will store messages in its internal queue until capacity limit is reached and the send() method will return immediately even if no receiver is ready to handle the message Configuring Message Channels < c h a n n e l i d = " e x a m p l e C h a n n e l " / > < c h a n n e l i d = " e x a m p l e C h a n n e l " c a p a c i t y = " 1 0 0 " / > < c h a n n e l i d = " e x a m p l e C h a n n e l " p u b l i s h - s u b s c r i b e = " t r u e " / > < c h a n n e l i d = " n u m b e r C h a n n e l " d a t a t y p e = " j a v a. l a n g. N u m b e r " / > < c h a n n e l i d = " e x a m p l e C h a n n e l " p u b l i s h - s u b s c r i b e = " t r u e " > < d i s p a t c h e r - p o l i c y m a x - m e s s a g e s - p e r - t a s k = " 2 5 " r e c e i v e - t i m e o u t = " 1 0 " r e j e c t i o n - l i m i t = " 3 " r e t r y - i n t e r v a l = " 5 0 0 " s h o u l d - f a i l - o n - r e j e c t i o n - l i m i t = " f a l s e " / > < / c h a n n e l > 13 14 PriorityChannel implementation No FIFO, but ChannelInterceptor p u b l i c i n t e r f a c e C h a n n e l I n t e r c e p t o r allows for messages to be ordered within the channel based upon a priority By default the priority is determined by the 'priority' property within each message's header However, for custom priority determination logic, a comparator of type C o m p a r a t o r < M e s s a g e <? > > can be provided to the PriorityChannel's constructor { b o o l e a n p r e S e n d ( M e s s a g e <? > m e s s a g e, M e s s a g e C h a n n e l c h a n n e l ) ; v o i d p o s t S e n d ( M e s s a g e <? > m e s s a g e, M e s s a g e C h a n n e l c h a n n e l, b o o l e a n s e n t ) ; b o o l e a n p r e R e c e i v e ( M e s s a g e C h a n n e l c h a n n e l ) ; v o i d p o s t R e c e i v e ( M e s s a g e <? > m e s s a g e, M e s s a g e C h a n n e l c h a n n e l ) ; < p r i o r i t y - c h a n n e l i d = " e x a m p l e C h a n n e l " < c h a n n e l i d = " e x a m p l e C h a n n e l " > d a t a t y p e = " e x a m p l e. W i d g e t " < i n t e r c e p t o r r e f = " t r a f fi c M o n i t o r i n g I n t e r c e p t o r " / > c o m p a r a t o r - r e f = " w i d g e t C o m p a r a t o r " / > < / c h a n n e l > 15 16

ChannelInterceptorAdapter Because it is rarely necessary to implement all of the interceptor methods It provides no-op methods (the void methods are empty, and the boolean methods return true) p u b l i c c l a s s C o u n t i n g C h a n n e l I n t e r c e p t o r e x t e n d s C h a n n e l I n t e r c e p t o r A d a p t e r { p r i v a t e fi n a l A t o m i c I n t e g e r s e n d C o u n t = @ O v e r r i d e n e w A t o m i c I n t e g e r ( ) ; p u b l i c b o o l e a n p r e S e n d ( M e s s a g e <? > m e s s a g e, M e s s a g e C h a n n e l c h a n n e l ) { Message Endpoint Provides an abstraction for message producers and consumers Adapts input sources and output targets Handles invocation of local services Cleanly separates messaging concerns from business components Acts as a Messaging Gateway for the application Supports multiple consumer strategies Polling or Event-driven Selective Consumers, Competing Consumers s e n d C o u n t. i n c r e m e n t A n d G e t ( ) ; r e t u r n t r u e ; 17 18 Configuring Message Endpoints Configuring Message Endpoints < e n d p o i n t i n p u t - c h a n n e l = " e x a m p l e C h a n n e l " h a n d l e r - r e f = " e x a m p l e H a n d l e r " / > < e n d p o i n t i n p u t - c h a n n e l = " e x a m p l e C h a n n e l " h a n d l e r - r e f = " e x a m p l e H a n d l e r " / > < s c h e d u l e p e r i o d = " 3 0 0 0 " / > < e n d p o i n t i n p u t - c h a n n e l = " e x a m p l e C h a n n e l " < / e n d p o i n t > h a n d l e r - r e f = " s o m e P o j o " h a n d l e r - m e t h o d = " s o m e M e t h o d " d e f a u l t - o u t p u t - c h a n n e l = " r e p l y C h a n n e l " / > < e n d p o i n t i n p u t - c h a n n e l = " e x a m p l e C h a n n e l " h a n d l e r - r e f = " e x a m p l e H a n d l e r " / > < c o n c u r r e n c y c o r e = " 5 " m a x = " 2 5 " < e n d p o i n t i d = " e n d p o i n t " i n p u t - c h a n n e l = " c h a n n e l " q u e u e - c a p a c i t y = " 2 0 " k e e p - a l i v e = " 1 2 0 " / > h a n d l e r - r e f = " h a n d l e r " > < / e n d p o i n t > < s e l e c t o r r e f = " e x a m p l e S e l e c t o r " / > < / e n d p o i n t > 19 20

Channel Adapter interacting with external systems or other components that are external to the messaging system Channel Adapter Connect a source to the messaging system so it can send to a Message Channel As the name implies, the interaction consists of adapting the external system or component to send-to and/or receive-from a MessageChannel Source Adapters and Target Adapters JMS, File, FTP, RMI, Webservice, Stream, Mail, HTTP, ApplicationEvent Connect a target to the messaging system so it can receive from a Message Channel 21 22 File Channel Adapters <si:message-bus/> <si:channel id= inputchannel /> <si:channel id= outputchannel /> <si:file-source id= filesourceadapter directory= ${java.io.tmpdir/test-input channel= inputchannel poll-period= 10000 /> <si:file-target id= filetargetadapter directory= ${java.io.tmpdir/test-output channel= outputchannel /> Delegating Target Adapters MethodInvokingTarget target = new MethodInvokingTarget(); target.setobject(new ExampleTarget()); target.setmethod( publish ); DefaultTargetAdapter adapter = new DefaultTargetAdapter(target); bus.registerhandler( adapter, adapter, new Subscription(channel)); channel.send(new StringMessage( foo )); 23 24

Service Activator A Message Endpoint that invokes a service Supports multiple communication styles one-way and request-reply synchronous and asynchronous The service is unaware of the messaging system MessageSelector reactive routing to determine what messages the handler should receive Datatype Channel and Message Router provide proactive routing p u b l i c i n t e r f a c e M e s s a g e S e l e c t o r { b o o l e a n a c c e p t ( M e s s a g e <? > m e s s a g e ) ; M e s s a g e E n d p o i n t can be configured with 0 or more selectors, will only receive messages that are accepted by each selector a couple of common selector implementations are provided 25 26 MessageSelector - PayloadTypeSelector P a y l o a d T y p e S e l e c t o r provides similar functionality to Datatype Channels except that in this case the type-matching can be done by the endpoint rather than the channel P a y l o a d T y p e S e l e c t o r s e l e c t o r = n e w P a y l o a d T y p e S e l e c t o r ( S t r i n g. c l a s s, I n t e g e r. c l a s s ) ; a s s e r t T r u e ( s e l e c t o r. a c c e p t ( n e w S t r i n g M e s s a g e ( " e x a m p l e " ) ) ) ; a s s e r t T r u e ( s e l e c t o r. a c c e p t ( n e w G e n e r i c M e s s a g e < I n t e g e r > ( 1 2 3 ) ) ) ; Message Router Particular type of M e s s a g e H a n d l e r Route messages to message channels Isolate routing strategy from business logic Provide a dynamic alternative to publish/subscribe channels Accommodate complex messaging scenarios Splitter, Aggregator, Resequencer a s s e r t F a l s e ( s e l e c t o r. a c c e p t ( n e w G e n e r i c M e s s a g e < M y O b j e c t > ( m y O b j e c t ) ) ) ; U n e x p i r e d M e s s a g e S e l e c t o r only accepts messages that have not yet expired 27 28

<context:component-scan base-package="org.springframework.integration.samples.oddeven"/> Router - example <message-bus auto-create-channels="true" /> <annotation-driven/> @ M e s s a g e E n d p o i n t p u b l i c c l a s s C o u n t e r { p r i v a t e A t o m i c I n t e g e r c o u n t = n e w A t o m i c I n t e g e r ( ) ; @ P o l l e d ( p e r i o d = 3 0 0 0 ) p u b l i c i n t g e t N u m b e r ( ) { r e t u r n c o u n t. i n c r e m e n t A n d G e t ( ) ; PayloadTypeRouter channelmappings.put(string.class, stringchannel); channelmappings.put(integer.class, integerchannel); PayloadTypeRouter router = new PayloadTypeRouter(); router.setchannelmappings(channelmappings); Message<String> message1 = new StringMessage( test ); Message<Integer> message2 = new GenericMessage<Integer>(123); router.handle(message1); // will send to stringchannel router.handle(message2); // will send to integerchannel @ R o u t e r p u b l i c S t r i n g r e s o l v e C h a n n e l ( i n t i ) { i f ( i % 2 = = 0 ) { Send to channel id= even r e t u r n " e v e n " ; r e t u r n " o d d " ; Send to channel id= odd 29 Präsentationskennung - Eintrag über Kopf-/Fusszeile 30 RecipientListRouter List<MessageChannel> channels = new ArrayList<MessageChannel>(); channels.add(channel1); channels.add(channel2); RecipientListRouter router = new RecipientListRouter(); router.setchannels(channels); MessageHandler A generic interface defines the simple but common behavior of processing a received Message p u b l i c i n t e r f a c e M e s s a g e H a n d l e r { M e s s a g e h a n d l e ( M e s s a g e m e s s a g e ) ; Message<String> message = new StringMessage( test ); // will send to channel1 and channel2 router.handle(message); Comparable to a dynamic publish/subscribe Many of the internal base messaging components implement this top-level interface Routers, Transformers, Service Invokers Implementations do not necessarily return a reply Message (routers, void-returning service invokers) Präsentationskennung - Eintrag über Kopf-/Fusszeile 31 32

Example: Message Translator MessageHandlerChain Convert payload type MessageHandlers can be linked together Enrich message content M e s s a g e H a n d l e r C h a i n c h a i n = Filter message content n e w M e s s a g e H a n d l e r C h a i n ( ) ; c h a i n. a d d ( n e w H a n d l e r 1 ( ) ) ; Normalize message format Multiple clients may send multiple versions The application may expect a canonical format c h a i n. a d d ( n e w H a n d l e r 2 ( ) ) ; c h a i n. a d d ( n e w H a n d l e r 3 ( ) ) ; M e s s a g e r e s u l t = c h a i n. h a n d l e ( n e w S t r i n g M e s s a g e ( f o o ) ) ; 33 34 Message Bus Message Bus The M e s s a g e B u s passes the messages from the channel to the handler ( is a mediator ) manage registration of the M e s s a g e C h a n n e l s and M e s s a g e H a n d l e r s creation and lifecycle management of message dispatcher Each channel has a DispatcherPolicy channel activation of handler subscriptions configuration of thread pools 35 36

Agenda Integration Blueprint Enterprise Integration Patterns Spring Integration Goals Main Components Architectures and other things Conclusion SEDA Matt Welsh, Ph.D. thesis work at UC Berkeley Decompose service into stages separated by queues Each stage performs a subset of request processing Stages internally event-driven Each stage contains a thread pool to drive stage execution However, threads are not exposed to applications Dynamic control grows/shrinks thread pools with demand 37 38 SEDA - Staged Event Driven Systems Alternative to thread-per-request server model Controlled number of threads per handler Ideal for short-lived tasks and high # of requests Agenda Integration Blueprint Enterprise Integration Patterns Spring Integration Goals Main Components Architectures and other things Conclusion 39 40

Develop and Test in one JVM Deploy to different JVMs 41 42 Integration Architecture host adapters per system Integration Architecture Data Grid Upcoming event: High Performance Computing 16.9.2008, 14.30h 43

The cool spring integration universe 45 Spring Integration and Spring Batch #2 Spring Integration and Spring Batch #3 47 48

Protoype Agenda Integration Blueprint Enterprise Integration Patterns Spring Integration Goals Spring Integration Principles Main Components Architectures and other things Conclusion 50 Conclusion - Spring Integration Spring framework extension for easy implementation of ESB develop for multicores Simple and powerful Easy to extend Spring & Spring Integration a winning team Thank you! Upcoming event: High Performance Computing 16.9.2008, 14.30h Oracle, Baden-Dättwil http://www.trivadis.com/events/kommende-events.html? www.trivadis.com 51 Basel Baden Bern Lausanne Zürich Düsseldorf Frankfurt/M. Freiburg i. Br. Hamburg München Stuttgart Wien