SlideShare a Scribd company logo
ENTERPRISE INTEGRATION PATTERNS: 
SPRING WAY 
Dragan Gajic
INTEGRATION 
• Creating a single, monolite app to cover 
all aspects of business is hard 
• Enterpises are comprised of 
applications which can be: custom 
build, 3rd party, legacy 
• Connecting computer systems, 
companies or people 
• Share data and processes
INTEGRATION CHALLENGES 
• Networks: unreliable & slow 
• Differences: language, platform & data format 
• Changes 
• Limited control 
• Standards 
• Maintenance
INTEGRATION STYLES 
• File transfer 
• Shared DB 
• RMI 
• Messaging 
• asyncronous 
• reliable transfer 
• common format (messages) 
• Loose coupling
MESSAGE AND CHANNEL 
• Message 
• Header – information about the data 
• Payload (body) – the data being transmitted 
• Channel 
Header 
Payload 
Header 
Payload 
• Point-to-Point 
• Publish-Subscribe 
Header 
Payload 
Header 
Payload 
Header 
Payload 
Producer Consumer
PIPES AND FILTERS 
Persist 
Pipe 
Create validation 
email 
Pipe Pipe 
Filter Filter 
Send validation 
email 
SMTP 
Pipe 
Filter 
USER 
Registration 
• Divide complex processing 
• Filters – independent processing steps 
• Pipes – connect filters into a sequence 
• Fundamental architectural style for messaging 
• Pipe = Channel 
• Filter = Endpoint
SPRING INTEGRATION 
• Top-level project in spring.io 
• Enables lightweight messaging 
• Combines DI, POJO and Messaging 
• Implements most of EIP 
• Includes wide selection of channel adapters 
• SI != MOM, ESB
EXAMPLE: USER REGISTRATION 
• After user registration validate email address by sending 
confirmation link to email and notify moderators about new 
profile 
• In steps: 
• Generate confirmation link (UUID) 
• Store userId -> UUID 
• Send confirmation email 
• Notify site moderators about the new profile 
SMTP 
ADMIN 
REST API
CHANNEL ADAPTER 
@RequestMapping(method = RequestMethod.POST) 
@ResponseStatus(HttpStatus.CREATED) 
public ProfileResource register(@Valid @RequestBody RegistrationResource registration) { 
Profile profile = profileService.save(regResToProfile.convert(registration)); 
publisher.publishEvent(new RegistrationEvent(this, profile)); 
return profileToProfileResource.convert(profile); 
} 
<int-event:inbound-channel-adapter channel="event-channel" 
event-types=“x.x.RegistrationEvent"/> 
<channel id="event-channel“ />
ENRICHER 
<header-enricher input-channel="event-channel"> 
<header name="uuid“ expression="T(java.util.UUID).randomUUID.toString()"/> 
</header-enricher>
WIRE-TAP 
<wire-tap channel="logger"/>
PIPING IT ALL TOGETHER 
<int-event:inbound-channel-adapter channel="event-channel" 
event-types="com.levi9.samples.eip.registration.event.RegistrationEvent" /> 
<channel id="event-channel" /> 
<header-enricher input-channel="event-channel" output-channel=“logger"> 
<header name="uuid" expression="T(java.util.UUID).randomUUID().toString()" /> 
</header-enricher> 
<logging-channel-adapter id="logger" level="INFO" log-full-message="true" />
COMPOSITE PROCESSOR
SPLITTER & ROUTER 
<splitter input-channel="confirmation-channel“ output-channel="splitted" method="split"> 
<beans:bean class="com.levi9.samples.eip.registration.splitter.ProfileSplitter" /> 
</splitter> 
<payload-type-router input-channel="splitted"> 
<mapping type="java.lang.Long" channel="save" /> 
<mapping type="com.levi9.samples.eip.registration.model.Profile" channel=“email" /> 
</payload-type-router> 
public Object[] split(RegistrationEvent event) { 
Profile profile = event.getProfile(); 
return new Object[] {profile.getId(), profile}; 
}
<service-activator input-channel="save" output-channel="done" 
expression="@profileService.pending(headers.uuid, payload)" /> 
<chain input-channel="email" output-channel="done"> 
<int-mail:header-enricher> 
<int-mail:from value="EIP" /> 
<int-mail:to expression="payload.email" /> 
<int-mail:subject value="Registration confirmation" /> 
</int-mail:header-enricher> 
<transformer 
expression="'Dear ' + payload.name + ', please click on the following link 
#{ environment['host.name'] }/confirm/' + headers.uuid 
+ ' in order to confirm email address.'" /> 
</chain> 
SERVICE ACTIVATOR & TRANSLATOR 
public boolean pending(String uuid, Long id) { 
return confirmations.put(uuid, id) == null; 
}
AGGREGATOR & MAIL ADAPTER 
public String aggregate(List<Message<?>> messages) { 
return (String) messages 
.stream() 
.filter(p -> p.getPayload() instanceof String) 
.findFirst().orElse(null).getPayload(); 
} 
<aggregator input-channel="done" method="aggregate" message-store=“store" 
output-channel="mail-outbound" > 
<bean class="com.levi9.samples.eip.registration.aggregator.ConfirmationAggregator"/> 
</aggregator> 
<channel id="mail-outbound" /> 
<int-mail:outbound-channel-adapter channel="mail-outbound" 
host="#{ environment['mail.smtp.host']}" 
port="#{ environment['mail.smtp.port']}" /> 
<bean id=“store" class="org.springframework.integration.store.SimpleMessageStore" />
MESSAGING SYSTEM 
message 
SMTP 
ADMIN 
REST API
DEMO 
https://gitlab.levi9.com/d.gajic/eip/tree/code3
RESOURCES 
• Book 
• Enterprise Integration Patterns 
• Gregor Hohpe, Bobby Woolf 
• Spring Integration 
• http://projects.spring.io/spring-integration 
• Samples 
• https://gitlab.levi9.com/d.gajic/eip.git 
• Patterns 
• http://www.enterpriseintegrationpatterns.com
Q&A

More Related Content

What's hot

Microsoft exchange
Microsoft exchangeMicrosoft exchange
Microsoft exchange
saeed ismail
 
Content migration Part 1: TERMINALFOUR t44u 2013
Content migration Part 1: TERMINALFOUR t44u 2013Content migration Part 1: TERMINALFOUR t44u 2013
Content migration Part 1: TERMINALFOUR t44u 2013
Terminalfour
 
The World Needs an Alternative to SharePoint
The World Needs an Alternative to SharePointThe World Needs an Alternative to SharePoint
The World Needs an Alternative to SharePoint
Alfresco Software
 
Testing web services
Testing web servicesTesting web services
Testing web services
Taras Lytvyn
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
Madhuri Kavade
 
SharePoint 2007 Presentation
SharePoint 2007 PresentationSharePoint 2007 Presentation
SharePoint 2007 Presentation
Ajay Jain
 
Web API Basics
Web API BasicsWeb API Basics
Web API Basics
LearnNowOnline
 
Newcastle University: Content migration made easy
Newcastle University: Content migration made easyNewcastle University: Content migration made easy
Newcastle University: Content migration made easy
Terminalfour
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
Bilal Amjad
 
10 ways to trigger runbooks from Orchestrator
10 ways to trigger runbooks from Orchestrator10 ways to trigger runbooks from Orchestrator
10 ways to trigger runbooks from Orchestrator
Fredrik Knalstad
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
Ben Robb
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
Jef Claes
 
Getting Started with Orchestrator and Service Manager
Getting Started with Orchestrator and Service ManagerGetting Started with Orchestrator and Service Manager
Getting Started with Orchestrator and Service Manager
Alexandre Verkinderen
 
SCORCH: Tying it All Together
SCORCH: Tying it All TogetherSCORCH: Tying it All Together
SCORCH: Tying it All Together
C/D/H Technology Consultants
 
Tutorial asp.net
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
Vivek K. Singh
 
Build your Business Services using ADF Task Flows
Build your Business Services using ADF Task FlowsBuild your Business Services using ADF Task Flows
Build your Business Services using ADF Task Flows
DataNext Solutions
 
Elements_Architecture_and_Technology.pdf
Elements_Architecture_and_Technology.pdfElements_Architecture_and_Technology.pdf
Elements_Architecture_and_Technology.pdf
Jeff Smith
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
How business objects upgrade time can be reduced by 80% and keys to prepare n...
How business objects upgrade time can be reduced by 80% and keys to prepare n...How business objects upgrade time can be reduced by 80% and keys to prepare n...
How business objects upgrade time can be reduced by 80% and keys to prepare n...
Sebastien Goiffon
 

What's hot (19)

Microsoft exchange
Microsoft exchangeMicrosoft exchange
Microsoft exchange
 
Content migration Part 1: TERMINALFOUR t44u 2013
Content migration Part 1: TERMINALFOUR t44u 2013Content migration Part 1: TERMINALFOUR t44u 2013
Content migration Part 1: TERMINALFOUR t44u 2013
 
The World Needs an Alternative to SharePoint
The World Needs an Alternative to SharePointThe World Needs an Alternative to SharePoint
The World Needs an Alternative to SharePoint
 
Testing web services
Testing web servicesTesting web services
Testing web services
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
SharePoint 2007 Presentation
SharePoint 2007 PresentationSharePoint 2007 Presentation
SharePoint 2007 Presentation
 
Web API Basics
Web API BasicsWeb API Basics
Web API Basics
 
Newcastle University: Content migration made easy
Newcastle University: Content migration made easyNewcastle University: Content migration made easy
Newcastle University: Content migration made easy
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
10 ways to trigger runbooks from Orchestrator
10 ways to trigger runbooks from Orchestrator10 ways to trigger runbooks from Orchestrator
10 ways to trigger runbooks from Orchestrator
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
 
Getting Started with Orchestrator and Service Manager
Getting Started with Orchestrator and Service ManagerGetting Started with Orchestrator and Service Manager
Getting Started with Orchestrator and Service Manager
 
SCORCH: Tying it All Together
SCORCH: Tying it All TogetherSCORCH: Tying it All Together
SCORCH: Tying it All Together
 
Tutorial asp.net
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
 
Build your Business Services using ADF Task Flows
Build your Business Services using ADF Task FlowsBuild your Business Services using ADF Task Flows
Build your Business Services using ADF Task Flows
 
Elements_Architecture_and_Technology.pdf
Elements_Architecture_and_Technology.pdfElements_Architecture_and_Technology.pdf
Elements_Architecture_and_Technology.pdf
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
 
How business objects upgrade time can be reduced by 80% and keys to prepare n...
How business objects upgrade time can be reduced by 80% and keys to prepare n...How business objects upgrade time can be reduced by 80% and keys to prepare n...
How business objects upgrade time can be reduced by 80% and keys to prepare n...
 

Similar to Enterprise Integration Patterns - Spring way

Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
clairvoyantllc
 
Spring integration
Spring integrationSpring integration
Spring integration
Dominik Strzyżewski
 
RESTful application with JAX-RS and how to expose and test them
RESTful application with JAX-RS and how to expose and test themRESTful application with JAX-RS and how to expose and test them
RESTful application with JAX-RS and how to expose and test them
Kumaraswamy M
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 
Rest
RestRest
Wso2 integration platform deep dive eu con 2016
Wso2 integration platform deep dive   eu con 2016Wso2 integration platform deep dive   eu con 2016
Wso2 integration platform deep dive eu con 2016
Chanaka Fernando
 
Global Scale ESB with Mule
Global Scale ESB with MuleGlobal Scale ESB with Mule
Global Scale ESB with Mule
Andrew Kennedy
 
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep DiveWSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2
 
SCIM presentation from CIS 2012
SCIM presentation from CIS 2012SCIM presentation from CIS 2012
SCIM presentation from CIS 2012
Twobo Technologies
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
ParrotBAD
 
Sprintintegration ajip
Sprintintegration ajipSprintintegration ajip
Sprintintegration ajip
Makarand Bhatambarekar
 
RPI Infor Process Automation Presentation
RPI Infor Process Automation PresentationRPI Infor Process Automation Presentation
RPI Infor Process Automation Presentation
Richard Leigh Stout
 
Many Faces Of Bi Publisher In Oracle Ebs
Many Faces Of Bi Publisher In Oracle EbsMany Faces Of Bi Publisher In Oracle Ebs
Many Faces Of Bi Publisher In Oracle Ebs
Hossam El-Faxe
 
Spring integration
Spring integrationSpring integration
Spring integration
Zülfikar Karakaya
 
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates UncoveredRuslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
LinkedIn
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
José Román Martín Gil
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
BIOVIA
 
Deep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaSDeep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaS
Apigee | Google Cloud
 
Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10
Hamza Malik
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 

Similar to Enterprise Integration Patterns - Spring way (20)

Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
 
Spring integration
Spring integrationSpring integration
Spring integration
 
RESTful application with JAX-RS and how to expose and test them
RESTful application with JAX-RS and how to expose and test themRESTful application with JAX-RS and how to expose and test them
RESTful application with JAX-RS and how to expose and test them
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Rest
RestRest
Rest
 
Wso2 integration platform deep dive eu con 2016
Wso2 integration platform deep dive   eu con 2016Wso2 integration platform deep dive   eu con 2016
Wso2 integration platform deep dive eu con 2016
 
Global Scale ESB with Mule
Global Scale ESB with MuleGlobal Scale ESB with Mule
Global Scale ESB with Mule
 
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep DiveWSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
 
SCIM presentation from CIS 2012
SCIM presentation from CIS 2012SCIM presentation from CIS 2012
SCIM presentation from CIS 2012
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
Sprintintegration ajip
Sprintintegration ajipSprintintegration ajip
Sprintintegration ajip
 
RPI Infor Process Automation Presentation
RPI Infor Process Automation PresentationRPI Infor Process Automation Presentation
RPI Infor Process Automation Presentation
 
Many Faces Of Bi Publisher In Oracle Ebs
Many Faces Of Bi Publisher In Oracle EbsMany Faces Of Bi Publisher In Oracle Ebs
Many Faces Of Bi Publisher In Oracle Ebs
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates UncoveredRuslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
Deep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaSDeep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaS
 
Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 

Recently uploaded

E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 

Recently uploaded (20)

E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 

Enterprise Integration Patterns - Spring way

  • 1. ENTERPRISE INTEGRATION PATTERNS: SPRING WAY Dragan Gajic
  • 2. INTEGRATION • Creating a single, monolite app to cover all aspects of business is hard • Enterpises are comprised of applications which can be: custom build, 3rd party, legacy • Connecting computer systems, companies or people • Share data and processes
  • 3. INTEGRATION CHALLENGES • Networks: unreliable & slow • Differences: language, platform & data format • Changes • Limited control • Standards • Maintenance
  • 4. INTEGRATION STYLES • File transfer • Shared DB • RMI • Messaging • asyncronous • reliable transfer • common format (messages) • Loose coupling
  • 5. MESSAGE AND CHANNEL • Message • Header – information about the data • Payload (body) – the data being transmitted • Channel Header Payload Header Payload • Point-to-Point • Publish-Subscribe Header Payload Header Payload Header Payload Producer Consumer
  • 6. PIPES AND FILTERS Persist Pipe Create validation email Pipe Pipe Filter Filter Send validation email SMTP Pipe Filter USER Registration • Divide complex processing • Filters – independent processing steps • Pipes – connect filters into a sequence • Fundamental architectural style for messaging • Pipe = Channel • Filter = Endpoint
  • 7. SPRING INTEGRATION • Top-level project in spring.io • Enables lightweight messaging • Combines DI, POJO and Messaging • Implements most of EIP • Includes wide selection of channel adapters • SI != MOM, ESB
  • 8. EXAMPLE: USER REGISTRATION • After user registration validate email address by sending confirmation link to email and notify moderators about new profile • In steps: • Generate confirmation link (UUID) • Store userId -> UUID • Send confirmation email • Notify site moderators about the new profile SMTP ADMIN REST API
  • 9. CHANNEL ADAPTER @RequestMapping(method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public ProfileResource register(@Valid @RequestBody RegistrationResource registration) { Profile profile = profileService.save(regResToProfile.convert(registration)); publisher.publishEvent(new RegistrationEvent(this, profile)); return profileToProfileResource.convert(profile); } <int-event:inbound-channel-adapter channel="event-channel" event-types=“x.x.RegistrationEvent"/> <channel id="event-channel“ />
  • 10. ENRICHER <header-enricher input-channel="event-channel"> <header name="uuid“ expression="T(java.util.UUID).randomUUID.toString()"/> </header-enricher>
  • 12. PIPING IT ALL TOGETHER <int-event:inbound-channel-adapter channel="event-channel" event-types="com.levi9.samples.eip.registration.event.RegistrationEvent" /> <channel id="event-channel" /> <header-enricher input-channel="event-channel" output-channel=“logger"> <header name="uuid" expression="T(java.util.UUID).randomUUID().toString()" /> </header-enricher> <logging-channel-adapter id="logger" level="INFO" log-full-message="true" />
  • 14. SPLITTER & ROUTER <splitter input-channel="confirmation-channel“ output-channel="splitted" method="split"> <beans:bean class="com.levi9.samples.eip.registration.splitter.ProfileSplitter" /> </splitter> <payload-type-router input-channel="splitted"> <mapping type="java.lang.Long" channel="save" /> <mapping type="com.levi9.samples.eip.registration.model.Profile" channel=“email" /> </payload-type-router> public Object[] split(RegistrationEvent event) { Profile profile = event.getProfile(); return new Object[] {profile.getId(), profile}; }
  • 15. <service-activator input-channel="save" output-channel="done" expression="@profileService.pending(headers.uuid, payload)" /> <chain input-channel="email" output-channel="done"> <int-mail:header-enricher> <int-mail:from value="EIP" /> <int-mail:to expression="payload.email" /> <int-mail:subject value="Registration confirmation" /> </int-mail:header-enricher> <transformer expression="'Dear ' + payload.name + ', please click on the following link #{ environment['host.name'] }/confirm/' + headers.uuid + ' in order to confirm email address.'" /> </chain> SERVICE ACTIVATOR & TRANSLATOR public boolean pending(String uuid, Long id) { return confirmations.put(uuid, id) == null; }
  • 16. AGGREGATOR & MAIL ADAPTER public String aggregate(List<Message<?>> messages) { return (String) messages .stream() .filter(p -> p.getPayload() instanceof String) .findFirst().orElse(null).getPayload(); } <aggregator input-channel="done" method="aggregate" message-store=“store" output-channel="mail-outbound" > <bean class="com.levi9.samples.eip.registration.aggregator.ConfirmationAggregator"/> </aggregator> <channel id="mail-outbound" /> <int-mail:outbound-channel-adapter channel="mail-outbound" host="#{ environment['mail.smtp.host']}" port="#{ environment['mail.smtp.port']}" /> <bean id=“store" class="org.springframework.integration.store.SimpleMessageStore" />
  • 17. MESSAGING SYSTEM message SMTP ADMIN REST API
  • 19. RESOURCES • Book • Enterprise Integration Patterns • Gregor Hohpe, Bobby Woolf • Spring Integration • http://projects.spring.io/spring-integration • Samples • https://gitlab.levi9.com/d.gajic/eip.git • Patterns • http://www.enterpriseintegrationpatterns.com
  • 20. Q&A

Editor's Notes

  1. Information Portal Data Replication Shared Business Function SOA Distributed Business Process B2B Integration
  2. Data transport over network compared to the same on one computer requires taking into account much more things which can go wrong. This is because networks are generally unreliable and slow, which requires more complex implementations of data transport in order to achieve reliability not compromising performance. Changes: unavoidable Limited control: 3rd party or legacy Standards: XML – no semantics Maintenance: operation and maintenance (infrastructure automation)
  3. File: formats, frequency, transfer, sync issues (sharing data) DB: SQL RBDMS (standard) + ORM, schema issues (and relational model is not suitable for all use cases – NoSQL + NO encapsulation) (sharing data) RMI: encapsulation (Java RMI, WS SOAP), performance (local vs remote calls) (sharing functions) Messaging: Loose coupling: sender no longer has to depend on receiver internal data format (messages) nor its location (channels) or readiness (asynchronous + queuing)
  4. Message – data encapsulation Channel – decouples message producers from consumers Point-to-Point: only one receiver will consume particular message; channel CAN have multiple consumers Publish-Subscribe: broadcast any message to all subscribers
  5. Message – data encapsulation Channel – decouples message producers from consumers Routers – multiple outputs (location independency) Transformers: convert messages Endpoints: adapters
  6. Inbound Channel Adapter: connect an application to the messaging system so that it can send and receive messages (Spring application events in this case) Direct Channel: point to point semantics Message: payload = RegistrationEvent
  7. Content Enricher: appends data to the message – headers and/or payload (use expression to generate UUID and add to the message header)
  8. Wire Tap: publishes each incoming message to the main channel and a secondary channel (per channel or global)
  9. Inbound Channel Adapter: connect an application to the messaging system so that it can send and receive messages (Spring application events in this case) Content Enricher: appends data to the message – headers and/or payload (use expression to generate UUID and add to the message header) Wire Tap: publishes each incoming message to the main channel and a secondary channel (per channel or global)
  10. Composite processor: splits the message up, routes the sub messages to appropriate destinations and aggregates responses (harder because of the asynchronous nature).
  11. Composite processor: splits the message up, routes the sub messages to appropriate destinations and aggregates responses (harder because of the asynchronous nature).
  12. Composite processor: splits the message up, routes the sub messages to appropriate destinations and aggregates responses (harder because of the asynchronous nature).
  13. Composite processor: splits the message up, routes the sub messages to appropriate destinations and aggregates responses (harder because of the asynchronous nature).
  14. Publisher-Subscriber: multiple consumers AMQP (RabbitMQ): inbound/outbound channel adapters
  15. Publisher-Subscriber: multiple consumers AMQP (RabbitMQ): inbound/outbound channel adapters
  16. File: DB: RMI: Messaging: