SlideShare une entreprise Scribd logo
1  sur  56
Introduction to
                 Spring Integration and Spring Batch
                                            Gunnar Hillert, Spring Integration Team
                                            Gary Russell, Spring Integration Team
                                                Twitter: @ghillert, @gprussell


© 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.
What we will cover...




• Spring Integration
• Spring Batch
• Using Spring Batch and Spring Integration together




  2
Spring Integration


3
Integration Styles

                                                       JVM           JVM


                                              Core Messaging
                                                               EAI


• Business to Business Integration (B2B)
• Inter Application Integration (EAI)
• Intra Application Integration

                                                    B2B


                                           External Business
                                                Partner




  4
Integration Styles




•   File Transfer
•   Shared Database
•   Remoting
•   Messaging




    5
Common Patterns




 Retrieve         Parse   Transform   Transmit




 6
Enterprise Integration Patterns

•   By Gregor Hohpe & Bobby Woolf
•   Published 2003
•   Collection of well-known patterns
•   http://www.eaipatterns.com/eaipatterns.html
•   Icon library provided




    7
“   Spring Integration provides an extension
           of the Spring programming model
         to support the well-known enterprise
                  integration patterns.




8
History

•   Nov 13, 2007 - First commit: Nov 13, 2007
•   Jan 23, 2008 - Spring Integration 1.0.0.M1
•   Nov 26, 2008 - Spring Integration 1.0.0
•   Nov 22, 2010 - Spring Integration 2.0.0
•   Jan 6, 2012 - Spring Integration 2.1.0
•   Sep 21, 2012 - Spring Integration 2.2.0.RC1

• 2013 - Spring Integration 3.0




    9
What is Spring Integration?

• Light-weight messaging framework
• Provides an adapter-based platform

• Pipes and Filters at the core of Spring Integration’s architecture
  – Endpoint (Filter)
  – Channel (Pipe)
  – Message




  10
Advantages


• Provides building blocks to implement systems that are:
  – are loosely Coupled (Logically or Physically)
  – are Event Driven (EDA)
  – have a staged event-driven architecture (SEDA)
• Sophisticated support for synchronous / asynchronous messaging




 11
Configuration

• XML Namespace Support
• Annotation Support (e.g. @Transformer, @Router, @ServiceActivator)

   <beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:int="http://www.springframework.org/schema/integration"
          xsi:schemaLocation="..">
   ...
       <int:channel id="orders"/>
       <int:splitter input-channel="orders" expression="payload.items"
            output-channel="drinks"/>
       <int:channel id="drinks"/>
       <int:router input-channel="drinks"
            expression="payload.iced ? 'coldDrinks' : 'hotDrinks'"/>
   ...
   </beans>


 12
Spring Integration DSLs

• Scala
           val messageFlow =
             filter {payload: String => payload == "World"} -->
             transform { payload: String => "Hello " + payload} -->
             handle { payload: String => println(payload) }

           messageFlow.send("World")




• Groovy
           def builder = new IntegrationBuilder()

           def flow = builder.messageFlow {
             transform {payload->payload.toUpperCase()}
             filter {payload-> payload =="HELLO"}
             handle {payload->payload}
           }

           assert flow.sendAndReceive("hello") == "HELLO"
           assert flow.sendAndReceive("world") == null


 13
Deployment Options


• Embedded as a library
• Stand-alone deployment
• War deployment




 14
What is in a Message?

• Unit of information
• Encapsulates data
• Passed between endpoints
• Consists of headers
  – contains data relevant to the messaging system
• and a payload
  – actual data for the receiver
  – depending on use-cases: POJO instances or serialized data




    15
What is in a Message?



      package org.springframework.integration;

      public interface Message<T> {

          MessageHeaders getHeaders();

          T getPayload();

      }


 16
Message Headers

•   Message ID (automatically generated UUID)
•   Timestamp
•   Correlation Id
•   Reply Channel
•   Error Channel
•   Expiration Date
•   Priority
•   ...

• Add your own headers using a Header Enricher


    17
Function of a Message



• Command Message
                        C

• Event Message
                            E

• Document Message
                        D




 18
What is a Channel?

• Channels connect producers and consumers (decoupling)
• MessageChannel Interface:
   – PollableChannel (Polling Consumer)
   – SubscribableChannel (Event Driven)
• Implementations:
   – DirectChannel
   – PublishSubscribeChannel
   – QueueChannel
                                               <int:channel id="input">
   – PriorityChannel                              <int:queue capacity="10"/>
                                               </int:channel>
   – RendezvousChannel
   – ExecutorChannel
 19
What is an Endpoint?

•   Polling or event-driven
•   Inbound or outbound
•   Unidirectional (Channel Adapter) or bidirectional (Gateway)
•   Internal or external (application context)

         <inbound-channel-adapter/>
         <outbound-channel-adapter/>
         <inbound-gateway/>
         <outbound-gateway/>
         <gateway/>
         <service-activator/>

    20
Router

•   Message Router
•   Content-based router
•   Recipient list router (dynamic)
•   Payload type router
•   Header value router
•   Exception type router




    21
Transformer

•   Delegating via ref/method
•   Spring Expression Language
•   Groovy, JRuby, Jython, JavaScript
•   Object-to-JSON / JSON-to-Object
•   Payload serializing/deserializing
•   File-to-bytes, File-to-String
•   JAXB, JibX, Castor, XMLBeans, Xstream
•   XPath, XSLT
•   Object XML Marshalling/Unmarshalling (Spring OXM)
•   ...


    22
Spring Integration Components


• Claim Check (In/Out)          • Service Activator
• Content Enricher              • Scripting support (JSR 223)
   – Header Enricher               – Ruby/JRuby, Javascript ...
   – Payload Enricher           • Groovy
• Control Bus                   • Message History
• Delayer                       • Message Store
• JMX Support                      – JDBC, Redis, MongoDB,
• Message Handler Chain               Gemfire
• Messaging Bridge              • Wire Tap
• Resequencer                   • ...

 23
Adapters


•    AMQP/RabbitMQ   •   MongoDB                               • Stored Procedures
•    AWS*            •   POP3/IMAP/SMTP                        • TCP/UDP
•    File/Resource   •   Print*                                • Twitter
•    FTP/FTPS/SFTP   •   Redis                                 • Web Services
•    GemFire         •   RMI                                     (SOAP or POX)
•    HTTP (REST)     •   RSS/Atom                              • XMPP
•    JDBC            •   SMB*                                  • XPath
•    JMS             •   Splunk*                               • XQuery*
•    JMX             •   Spring Application
•    JPA                 Events                                • ...
                     * Spring Integration Extensions Project


    24
Tooling - Spring Tool Suite (STS)

• Namespace Support
• Visualization
• 4 Spring Integration specific STS Templates
  – Simple Template (Core Components only)
  – File Polling Template (File Adapter)
  – War Template (Uses Twitter Adapter)
  – Adapter Template (Create your own components)




 25
Tooling - IntelliJ IDEA


•   Spring Integration support since IDEA 10.5
•   Namespace Support
•   Bean visualization
•   IntelliJ IDEA 12 (Preview) supports Spring Integration 2.1 & 2.2




    26
Tooling - C24 Integration Objects (C24iO) Studio

• Supports a variety of standards:
  – SWIFT
  – ISO20022
  – FIX
• Namespace Support:

   <int-c24:transformer/>
   <int-c24:validating-header-enricher/>
   <int-c24:marshalling-transformer/>
   ...


• http://www.c24.biz/io-spring.html


  27
Café Demo


28
Café Demo - Flow




 29
Samples

• https://github.com/SpringSource/spring-integration-samples

• Contains 50 Samples and Applications
• Several Categories:
  – Basic
  – Intermediate
  – Advanced
  – Applications




 30
Books

• Just Spring Integration
• Pro Spring Integration
• Spring Integration in Action




  31
Source Code


•   https://github.com/SpringSource/spring-integration
•   https://github.com/SpringSource/spring-integration-samples
•   https://github.com/SpringSource/spring-integration-extensions
•   https://github.com/SpringSource/spring-integration-templates
•   https://github.com/SpringSource/spring-integration-dsl-groovy
•   https://github.com/SpringSource/spring-integration-dsl-scala




    32
Contribute

• Post Question and Answers the Forums
  – http://forum.springsource.org/forumdisplay.php?42-Integration
• Create Jiras
  – https://jira.springsource.org/browse/INT
• Submit Pull Requests - Contributor Guidelines:
  – github.com/SpringSource/spring-integration/wiki/Contributor-Guidelines

• New Spring Integration Extensions Repository




 33
Spring Batch


34
Batch Jobs
 Differ from online/real-time processing applications:

• Long-running
  – Often outside office hours
• Non-interactive
  – Often include logic for handling errors or restarts
• Process large volumes of data
  – More than fits in memory or a single transaction


 35
Batch and offline processing
• Close of business processing
    – Order processing
    – Business reporting
    – Account reconciliation
• Import/export handling
    – a.k.a. ETL jobs (Extract-Transform-Load)
    – Instrument/position import
    – Data warehouse synchronization
• Large-scale output jobs
    – Loyalty scheme emails
    – Bank statements
•   36
Job and Step




37
Chunk-Oriented Processing
• Input-output can be grouped together
• Input collects Items before outputting:Chunk-Oriented Processing
• Optional ItemProcessor




 38
JobLauncher




39
Simple File Load Job




 40
More Complex Use Cases
• It's very common to use an off-the-shelf reader
  and writer
• More complex jobs often require custom readers
  or writers
• ItemProcessor is often used if there's a need to
  delegate to existing business logic
• Use a writer if it's more efficient to process a
  complete chunk



 41
Job and Step in Context




 42
JobRepository and Batch Metadata




43
ExecutionContext
• We need to know where a failure occurred to restart a batch
  process
• Job Repository metadata is used to determine the step at
  which the failure occurred
• Application Code (in reader/writer) needs to maintain state
  within a step (e.g. current chunk)
• Spring Batch can supply that data during restart to facilitate
  repositioning



 44
Common Batch Idioms
• Batch jobs typically process large amounts of homogeneous
  input
• Makes iteration a common concern: Repeat
• Transient errors during processing may require a Retry of
  an input item
• Some input may not be valid, may want to Skip it without
  failing
• Some errors should fail the job execution, allowing one to fix
  the problem and Restart the job instance where it left off

 45
Spring Batch
• Spring Batch supports these common concerns

• Abstracts them in the framework
 – Job business logic doesn't need to care about details

• Allows for simple configuration with pluggable strategies




 46
Business Logic Delegation – Spring Application




 47
Business Logic Delegation – Spring Integration




 48
Spring Batch Admin
• Sub project of Spring Batch
• Provides Web UI and ReSTFul interface to manage batch
  processes

• Manager, Resources, Sample WAR
 – Deployed with batch job(s) as single app to be able to control &
  monitor jobs
 – Or monitors external jobs only via shared database



 49
Scaling and Parallel Processing
• First Rule:
  – Use the simplest technique to get the job done in the required
   time
  – Do not optimize/parallelize unnecessarily

• Options:
  –   Multi-threaded Step (single process)
  –   Parallel Steps (single process)
  –   Remote Chunking of Step (multi process)
  –   Partitioning a Step (single or multi process)

 50
Using Spring Batch
            and
     Spring Integration
          together
51
Launching batch jobs through messages

• Event-Driven execution of the JobLauncher
• Spring Integration retrieves the data (e.g. file system, FTP, ...)
• Easy to support separate input sources simultaneously

              Inbound Channel Adapter          Transformer


       FTP




                                        D
                                File                           C
                                            JobLaunchRequest

                                                                   JobLauncher




  52
Providing feedback with informational messages

• Spring Batch provides support for listeners:
  – StepListener
  – ChunkListener
  – JobExecutionListener

             <batch:job id="importPayments">
               ...
               <batch:listeners>
                   <batch:listener ref="notificationExecutionsListener"/>
               </batch:listeners>
             </batch:job>

             <int:gateway id="notificationExecutionsListener"
               service-interface="o.s.batch.core.JobExecutionListener"
               default-request-channel="jobExecutions"/>


  53
Externalizing batch process execution

• Use Spring Integration inside of Batch jobs, e.g.:
  – ItemProcessor
  – ItemWriter
• Offload complex processing
• Asynchronous processing support:
  – AsyncItemProcessor
  – AsyncItemWriter
• Externalize chunk processing using ChunkMessageChannelItemWriter




 54
Learn More. Stay Connected.
At SpringOne 2GX:

• Building an Enterprise CRM with Grails and Spring Integration
• What's New in Spring Integration
• Spring Integration in the Wild
• Batch Processing and Integration on Cloud Foundry
• Building for Performance with Spring Integration & Spring Batch
• Spring Integration, Batch, and Data: Future Directions
• Managing and Monitoring Spring Integration Applications
• Java Batch JSR-352


 55
Learn More. Stay Connected.
• Web: www.springintegration.org
• Twitter: @m_f_ @ghillert @z_oleg @gprussell




                         Questions?

                               Thank You!!




 56

Contenu connexe

Tendances

Introduction to Kafka with Spring Integration
Introduction to Kafka with Spring IntegrationIntroduction to Kafka with Spring Integration
Introduction to Kafka with Spring IntegrationBorislav Markov
 
Spring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSLSpring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSLAndrey Krivtsun
 
Connectors in mule
Connectors in muleConnectors in mule
Connectors in muleSindhu VL
 
Mule esb whole_web_services
Mule esb whole_web_servicesMule esb whole_web_services
Mule esb whole_web_servicesNaresh Naidu
 
Overview of Mule
Overview of MuleOverview of Mule
Overview of Mulemdfkhan625
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guideSindhu VL
 
An introduction to Apache Camel
An introduction to Apache CamelAn introduction to Apache Camel
An introduction to Apache CamelKapil Kumar
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - muleSindhu VL
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts componentskunal vishe
 
Ashok mule esb
Ashok mule esbAshok mule esb
Ashok mule esbaskumar037
 

Tendances (16)

Mule overview
Mule overviewMule overview
Mule overview
 
Introduction to Kafka with Spring Integration
Introduction to Kafka with Spring IntegrationIntroduction to Kafka with Spring Integration
Introduction to Kafka with Spring Integration
 
Mule Requester Usage Demo
Mule Requester Usage DemoMule Requester Usage Demo
Mule Requester Usage Demo
 
Spring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSLSpring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSL
 
Connectors in mule
Connectors in muleConnectors in mule
Connectors in mule
 
Mule esb whole_web_services
Mule esb whole_web_servicesMule esb whole_web_services
Mule esb whole_web_services
 
Overview of Mule
Overview of MuleOverview of Mule
Overview of Mule
 
Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guide
 
An introduction to Apache Camel
An introduction to Apache CamelAn introduction to Apache Camel
An introduction to Apache Camel
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - mule
 
Mule UDP Transport
Mule UDP TransportMule UDP Transport
Mule UDP Transport
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts components
 
Niranjan mule esb
Niranjan mule esbNiranjan mule esb
Niranjan mule esb
 
Ashok mule esb
Ashok mule esbAshok mule esb
Ashok mule esb
 
Mule esb kranthi
Mule esb kranthiMule esb kranthi
Mule esb kranthi
 

En vedette

Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationGunnar Hillert
 
Spring Web Service, Spring Integration and Spring Batch
Spring Web Service, Spring Integration and Spring BatchSpring Web Service, Spring Integration and Spring Batch
Spring Web Service, Spring Integration and Spring BatchEberhard Wolff
 
Big Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC Systems
Big Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC SystemsBig Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC Systems
Big Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC SystemsFujio Turner
 
基于Spring batch的大数据量并行处理
基于Spring batch的大数据量并行处理基于Spring batch的大数据量并行处理
基于Spring batch的大数据量并行处理Jacky Chi
 
Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)lyonjug
 
Hadoop vs Java Batch Processing JSR 352
Hadoop vs Java Batch Processing JSR 352Hadoop vs Java Batch Processing JSR 352
Hadoop vs Java Batch Processing JSR 352Armel Nene
 
Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom UsageJoshua Long
 
Pivotal HAWQ - High Availability (2014)
Pivotal HAWQ - High Availability (2014)Pivotal HAWQ - High Availability (2014)
Pivotal HAWQ - High Availability (2014)saravana krishnamurthy
 
Parallel batch processing with spring batch slideshare
Parallel batch processing with spring batch   slideshareParallel batch processing with spring batch   slideshare
Parallel batch processing with spring batch slideshareMorten Andersen-Gott
 
Enterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud FoundryEnterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud FoundryJoshua Long
 
Ahea Team Spring batch
Ahea Team Spring batchAhea Team Spring batch
Ahea Team Spring batchSunghyun Roh
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the ScenesJoshua Long
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP IntroductionIwein Fuld
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache CamelKenneth Peeples
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresChristian Posta
 
Polyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQPolyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQChristian Posta
 
Spring integration概要
Spring integration概要Spring integration概要
Spring integration概要kuroiwa
 
Pattern driven Enterprise Architecture
Pattern driven Enterprise ArchitecturePattern driven Enterprise Architecture
Pattern driven Enterprise ArchitectureWSO2
 
Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Sam Brannen
 

En vedette (20)

Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring Integration
 
Spring Web Service, Spring Integration and Spring Batch
Spring Web Service, Spring Integration and Spring BatchSpring Web Service, Spring Integration and Spring Batch
Spring Web Service, Spring Integration and Spring Batch
 
Big Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC Systems
Big Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC SystemsBig Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC Systems
Big Data - In-Memory Index / Sub Second Query engine - Roxie - HPCC Systems
 
基于Spring batch的大数据量并行处理
基于Spring batch的大数据量并行处理基于Spring batch的大数据量并行处理
基于Spring batch的大数据量并行处理
 
Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)
 
Hadoop vs Java Batch Processing JSR 352
Hadoop vs Java Batch Processing JSR 352Hadoop vs Java Batch Processing JSR 352
Hadoop vs Java Batch Processing JSR 352
 
Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom Usage
 
The Spring Update
The Spring UpdateThe Spring Update
The Spring Update
 
Pivotal HAWQ - High Availability (2014)
Pivotal HAWQ - High Availability (2014)Pivotal HAWQ - High Availability (2014)
Pivotal HAWQ - High Availability (2014)
 
Parallel batch processing with spring batch slideshare
Parallel batch processing with spring batch   slideshareParallel batch processing with spring batch   slideshare
Parallel batch processing with spring batch slideshare
 
Enterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud FoundryEnterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud Foundry
 
Ahea Team Spring batch
Ahea Team Spring batchAhea Team Spring batch
Ahea Team Spring batch
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the Scenes
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP Introduction
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache Camel
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new features
 
Polyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQPolyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQ
 
Spring integration概要
Spring integration概要Spring integration概要
Spring integration概要
 
Pattern driven Enterprise Architecture
Pattern driven Enterprise ArchitecturePattern driven Enterprise Architecture
Pattern driven Enterprise Architecture
 
Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2
 

Similaire à S2GX 2012 - Introduction to Spring Integration and Spring Batch

Spring Batch Performance Tuning
Spring Batch Performance TuningSpring Batch Performance Tuning
Spring Batch Performance TuningGunnar Hillert
 
Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with SpringSam Brannen
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsDamien Dallimore
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
Solving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelSolving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelChristian Posta
 
MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?DrupalCamp Kyiv
 
Gwt cdi jaxrs_hbraun
Gwt cdi jaxrs_hbraunGwt cdi jaxrs_hbraun
Gwt cdi jaxrs_hbraunhbraun
 
WSO2 Quarterly Technical Update
WSO2 Quarterly Technical UpdateWSO2 Quarterly Technical Update
WSO2 Quarterly Technical UpdateWSO2
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nltieleman
 
Better Enterprise Integration With the WSO2 ESB 4.5.1
Better Enterprise Integration With the WSO2 ESB 4.5.1Better Enterprise Integration With the WSO2 ESB 4.5.1
Better Enterprise Integration With the WSO2 ESB 4.5.1WSO2
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nlbartzon
 
Essential Camel Components
Essential Camel ComponentsEssential Camel Components
Essential Camel ComponentsChristian Posta
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersSATOSHI TAGOMORI
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferaydaveayan
 
An Azure of Things, a developer’s perspective
An Azure of Things, a developer’s perspectiveAn Azure of Things, a developer’s perspective
An Azure of Things, a developer’s perspectiveBizTalk360
 
Effective admin and development in iib
Effective admin and development in iibEffective admin and development in iib
Effective admin and development in iibm16k
 
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...WSO2
 

Similaire à S2GX 2012 - Introduction to Spring Integration and Spring Batch (20)

Spring Batch Performance Tuning
Spring Batch Performance TuningSpring Batch Performance Tuning
Spring Batch Performance Tuning
 
Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with Spring
 
Node.js
Node.jsNode.js
Node.js
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
Solving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelSolving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache Camel
 
MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?
 
Gwt cdi jaxrs_hbraun
Gwt cdi jaxrs_hbraunGwt cdi jaxrs_hbraun
Gwt cdi jaxrs_hbraun
 
WSO2 Quarterly Technical Update
WSO2 Quarterly Technical UpdateWSO2 Quarterly Technical Update
WSO2 Quarterly Technical Update
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Better Enterprise Integration With the WSO2 ESB 4.5.1
Better Enterprise Integration With the WSO2 ESB 4.5.1Better Enterprise Integration With the WSO2 ESB 4.5.1
Better Enterprise Integration With the WSO2 ESB 4.5.1
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Essential Camel Components
Essential Camel ComponentsEssential Camel Components
Essential Camel Components
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferay
 
EIP In Practice
EIP In PracticeEIP In Practice
EIP In Practice
 
An Azure of Things, a developer’s perspective
An Azure of Things, a developer’s perspectiveAn Azure of Things, a developer’s perspective
An Azure of Things, a developer’s perspective
 
Effective admin and development in iib
Effective admin and development in iibEffective admin and development in iib
Effective admin and development in iib
 
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
 

Plus de Gunnar Hillert

High Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring DevelopersHigh Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring DevelopersGunnar Hillert
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersGunnar Hillert
 
Ajug - The Spring Update
Ajug - The Spring UpdateAjug - The Spring Update
Ajug - The Spring UpdateGunnar Hillert
 
s2gx2015 who needs batch
s2gx2015 who needs batchs2gx2015 who needs batch
s2gx2015 who needs batchGunnar Hillert
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsGunnar Hillert
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSocketsGunnar Hillert
 
S2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects InfrastructureS2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects InfrastructureGunnar Hillert
 
S2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring IntegrationS2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring IntegrationGunnar Hillert
 
Spring Projects Infrastructure
Spring Projects InfrastructureSpring Projects Infrastructure
Spring Projects InfrastructureGunnar Hillert
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersGunnar Hillert
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServicejRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServiceGunnar Hillert
 

Plus de Gunnar Hillert (13)

High Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring DevelopersHigh Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring Developers
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring Developers
 
Ajug - The Spring Update
Ajug - The Spring UpdateAjug - The Spring Update
Ajug - The Spring Update
 
s2gx2015 who needs batch
s2gx2015 who needs batchs2gx2015 who needs batch
s2gx2015 who needs batch
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSockets
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
S2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects InfrastructureS2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects Infrastructure
 
S2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring IntegrationS2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring Integration
 
Spring Projects Infrastructure
Spring Projects InfrastructureSpring Projects Infrastructure
Spring Projects Infrastructure
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring Developers
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServicejRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting Service
 

Dernier

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Dernier (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

S2GX 2012 - Introduction to Spring Integration and Spring Batch

  • 1. Introduction to Spring Integration and Spring Batch Gunnar Hillert, Spring Integration Team Gary Russell, Spring Integration Team Twitter: @ghillert, @gprussell © 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 2. What we will cover... • Spring Integration • Spring Batch • Using Spring Batch and Spring Integration together 2
  • 4. Integration Styles JVM JVM Core Messaging EAI • Business to Business Integration (B2B) • Inter Application Integration (EAI) • Intra Application Integration B2B External Business Partner 4
  • 5. Integration Styles • File Transfer • Shared Database • Remoting • Messaging 5
  • 6. Common Patterns Retrieve Parse Transform Transmit 6
  • 7. Enterprise Integration Patterns • By Gregor Hohpe & Bobby Woolf • Published 2003 • Collection of well-known patterns • http://www.eaipatterns.com/eaipatterns.html • Icon library provided 7
  • 8. Spring Integration provides an extension of the Spring programming model to support the well-known enterprise integration patterns. 8
  • 9. History • Nov 13, 2007 - First commit: Nov 13, 2007 • Jan 23, 2008 - Spring Integration 1.0.0.M1 • Nov 26, 2008 - Spring Integration 1.0.0 • Nov 22, 2010 - Spring Integration 2.0.0 • Jan 6, 2012 - Spring Integration 2.1.0 • Sep 21, 2012 - Spring Integration 2.2.0.RC1 • 2013 - Spring Integration 3.0 9
  • 10. What is Spring Integration? • Light-weight messaging framework • Provides an adapter-based platform • Pipes and Filters at the core of Spring Integration’s architecture – Endpoint (Filter) – Channel (Pipe) – Message 10
  • 11. Advantages • Provides building blocks to implement systems that are: – are loosely Coupled (Logically or Physically) – are Event Driven (EDA) – have a staged event-driven architecture (SEDA) • Sophisticated support for synchronous / asynchronous messaging 11
  • 12. Configuration • XML Namespace Support • Annotation Support (e.g. @Transformer, @Router, @ServiceActivator) <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xsi:schemaLocation=".."> ... <int:channel id="orders"/> <int:splitter input-channel="orders" expression="payload.items" output-channel="drinks"/> <int:channel id="drinks"/> <int:router input-channel="drinks" expression="payload.iced ? 'coldDrinks' : 'hotDrinks'"/> ... </beans> 12
  • 13. Spring Integration DSLs • Scala val messageFlow = filter {payload: String => payload == "World"} --> transform { payload: String => "Hello " + payload} --> handle { payload: String => println(payload) } messageFlow.send("World") • Groovy def builder = new IntegrationBuilder() def flow = builder.messageFlow { transform {payload->payload.toUpperCase()} filter {payload-> payload =="HELLO"} handle {payload->payload} } assert flow.sendAndReceive("hello") == "HELLO" assert flow.sendAndReceive("world") == null 13
  • 14. Deployment Options • Embedded as a library • Stand-alone deployment • War deployment 14
  • 15. What is in a Message? • Unit of information • Encapsulates data • Passed between endpoints • Consists of headers – contains data relevant to the messaging system • and a payload – actual data for the receiver – depending on use-cases: POJO instances or serialized data 15
  • 16. What is in a Message? package org.springframework.integration; public interface Message<T> { MessageHeaders getHeaders(); T getPayload(); } 16
  • 17. Message Headers • Message ID (automatically generated UUID) • Timestamp • Correlation Id • Reply Channel • Error Channel • Expiration Date • Priority • ... • Add your own headers using a Header Enricher 17
  • 18. Function of a Message • Command Message C • Event Message E • Document Message D 18
  • 19. What is a Channel? • Channels connect producers and consumers (decoupling) • MessageChannel Interface: – PollableChannel (Polling Consumer) – SubscribableChannel (Event Driven) • Implementations: – DirectChannel – PublishSubscribeChannel – QueueChannel <int:channel id="input"> – PriorityChannel <int:queue capacity="10"/> </int:channel> – RendezvousChannel – ExecutorChannel 19
  • 20. What is an Endpoint? • Polling or event-driven • Inbound or outbound • Unidirectional (Channel Adapter) or bidirectional (Gateway) • Internal or external (application context) <inbound-channel-adapter/> <outbound-channel-adapter/> <inbound-gateway/> <outbound-gateway/> <gateway/> <service-activator/> 20
  • 21. Router • Message Router • Content-based router • Recipient list router (dynamic) • Payload type router • Header value router • Exception type router 21
  • 22. Transformer • Delegating via ref/method • Spring Expression Language • Groovy, JRuby, Jython, JavaScript • Object-to-JSON / JSON-to-Object • Payload serializing/deserializing • File-to-bytes, File-to-String • JAXB, JibX, Castor, XMLBeans, Xstream • XPath, XSLT • Object XML Marshalling/Unmarshalling (Spring OXM) • ... 22
  • 23. Spring Integration Components • Claim Check (In/Out) • Service Activator • Content Enricher • Scripting support (JSR 223) – Header Enricher – Ruby/JRuby, Javascript ... – Payload Enricher • Groovy • Control Bus • Message History • Delayer • Message Store • JMX Support – JDBC, Redis, MongoDB, • Message Handler Chain Gemfire • Messaging Bridge • Wire Tap • Resequencer • ... 23
  • 24. Adapters • AMQP/RabbitMQ • MongoDB • Stored Procedures • AWS* • POP3/IMAP/SMTP • TCP/UDP • File/Resource • Print* • Twitter • FTP/FTPS/SFTP • Redis • Web Services • GemFire • RMI (SOAP or POX) • HTTP (REST) • RSS/Atom • XMPP • JDBC • SMB* • XPath • JMS • Splunk* • XQuery* • JMX • Spring Application • JPA Events • ... * Spring Integration Extensions Project 24
  • 25. Tooling - Spring Tool Suite (STS) • Namespace Support • Visualization • 4 Spring Integration specific STS Templates – Simple Template (Core Components only) – File Polling Template (File Adapter) – War Template (Uses Twitter Adapter) – Adapter Template (Create your own components) 25
  • 26. Tooling - IntelliJ IDEA • Spring Integration support since IDEA 10.5 • Namespace Support • Bean visualization • IntelliJ IDEA 12 (Preview) supports Spring Integration 2.1 & 2.2 26
  • 27. Tooling - C24 Integration Objects (C24iO) Studio • Supports a variety of standards: – SWIFT – ISO20022 – FIX • Namespace Support: <int-c24:transformer/> <int-c24:validating-header-enricher/> <int-c24:marshalling-transformer/> ... • http://www.c24.biz/io-spring.html 27
  • 29. Café Demo - Flow 29
  • 30. Samples • https://github.com/SpringSource/spring-integration-samples • Contains 50 Samples and Applications • Several Categories: – Basic – Intermediate – Advanced – Applications 30
  • 31. Books • Just Spring Integration • Pro Spring Integration • Spring Integration in Action 31
  • 32. Source Code • https://github.com/SpringSource/spring-integration • https://github.com/SpringSource/spring-integration-samples • https://github.com/SpringSource/spring-integration-extensions • https://github.com/SpringSource/spring-integration-templates • https://github.com/SpringSource/spring-integration-dsl-groovy • https://github.com/SpringSource/spring-integration-dsl-scala 32
  • 33. Contribute • Post Question and Answers the Forums – http://forum.springsource.org/forumdisplay.php?42-Integration • Create Jiras – https://jira.springsource.org/browse/INT • Submit Pull Requests - Contributor Guidelines: – github.com/SpringSource/spring-integration/wiki/Contributor-Guidelines • New Spring Integration Extensions Repository 33
  • 35. Batch Jobs Differ from online/real-time processing applications: • Long-running – Often outside office hours • Non-interactive – Often include logic for handling errors or restarts • Process large volumes of data – More than fits in memory or a single transaction 35
  • 36. Batch and offline processing • Close of business processing – Order processing – Business reporting – Account reconciliation • Import/export handling – a.k.a. ETL jobs (Extract-Transform-Load) – Instrument/position import – Data warehouse synchronization • Large-scale output jobs – Loyalty scheme emails – Bank statements • 36
  • 38. Chunk-Oriented Processing • Input-output can be grouped together • Input collects Items before outputting:Chunk-Oriented Processing • Optional ItemProcessor 38
  • 41. More Complex Use Cases • It's very common to use an off-the-shelf reader and writer • More complex jobs often require custom readers or writers • ItemProcessor is often used if there's a need to delegate to existing business logic • Use a writer if it's more efficient to process a complete chunk 41
  • 42. Job and Step in Context 42
  • 43. JobRepository and Batch Metadata 43
  • 44. ExecutionContext • We need to know where a failure occurred to restart a batch process • Job Repository metadata is used to determine the step at which the failure occurred • Application Code (in reader/writer) needs to maintain state within a step (e.g. current chunk) • Spring Batch can supply that data during restart to facilitate repositioning 44
  • 45. Common Batch Idioms • Batch jobs typically process large amounts of homogeneous input • Makes iteration a common concern: Repeat • Transient errors during processing may require a Retry of an input item • Some input may not be valid, may want to Skip it without failing • Some errors should fail the job execution, allowing one to fix the problem and Restart the job instance where it left off 45
  • 46. Spring Batch • Spring Batch supports these common concerns • Abstracts them in the framework – Job business logic doesn't need to care about details • Allows for simple configuration with pluggable strategies 46
  • 47. Business Logic Delegation – Spring Application 47
  • 48. Business Logic Delegation – Spring Integration 48
  • 49. Spring Batch Admin • Sub project of Spring Batch • Provides Web UI and ReSTFul interface to manage batch processes • Manager, Resources, Sample WAR – Deployed with batch job(s) as single app to be able to control & monitor jobs – Or monitors external jobs only via shared database 49
  • 50. Scaling and Parallel Processing • First Rule: – Use the simplest technique to get the job done in the required time – Do not optimize/parallelize unnecessarily • Options: – Multi-threaded Step (single process) – Parallel Steps (single process) – Remote Chunking of Step (multi process) – Partitioning a Step (single or multi process) 50
  • 51. Using Spring Batch and Spring Integration together 51
  • 52. Launching batch jobs through messages • Event-Driven execution of the JobLauncher • Spring Integration retrieves the data (e.g. file system, FTP, ...) • Easy to support separate input sources simultaneously Inbound Channel Adapter Transformer FTP D File C JobLaunchRequest JobLauncher 52
  • 53. Providing feedback with informational messages • Spring Batch provides support for listeners: – StepListener – ChunkListener – JobExecutionListener <batch:job id="importPayments"> ... <batch:listeners> <batch:listener ref="notificationExecutionsListener"/> </batch:listeners> </batch:job> <int:gateway id="notificationExecutionsListener" service-interface="o.s.batch.core.JobExecutionListener" default-request-channel="jobExecutions"/> 53
  • 54. Externalizing batch process execution • Use Spring Integration inside of Batch jobs, e.g.: – ItemProcessor – ItemWriter • Offload complex processing • Asynchronous processing support: – AsyncItemProcessor – AsyncItemWriter • Externalize chunk processing using ChunkMessageChannelItemWriter 54
  • 55. Learn More. Stay Connected. At SpringOne 2GX: • Building an Enterprise CRM with Grails and Spring Integration • What's New in Spring Integration • Spring Integration in the Wild • Batch Processing and Integration on Cloud Foundry • Building for Performance with Spring Integration & Spring Batch • Spring Integration, Batch, and Data: Future Directions • Managing and Monitoring Spring Integration Applications • Java Batch JSR-352 55
  • 56. Learn More. Stay Connected. • Web: www.springintegration.org • Twitter: @m_f_ @ghillert @z_oleg @gprussell Questions? Thank You!! 56

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  11. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  12. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  13. \n
  14. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  15. \n
  16. Message&lt;String&gt; helloMessage = MessageBuilder.withPayload(&quot;Hello, world!&quot;)\n.setHeader(&quot;custom.header&quot;, &quot;Value&quot;) .setHeaderIfAbsent(&quot;custom.header2&quot;, &quot;Value2&quot;) .build();\n
  17. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  18. In some applications it might be fine to send a reference to an\nobject over the channel, but in others it might be necessary to use a more interoperable representation like an identifier or a serialized version of the original data.\n
  19. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  20. messaging framework that supports lightweight, event-driven interactions within an\napplication\n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n