SlideShare a Scribd company logo
1 of 15
UseTest1
Probability of Default Microservice
RHD BrainBit, 01-03-2018
Bert Koorengevel –The Commitments
Und jetzt kommen die Kamele …
Agenda
• PDM – Enterprise Integration Patterns
• Wat is Apache Camel?
• Waarom gebruiken we Camel?
• Zijn er alternatieven?
• Hoe ziet een Camel project er uit?
PDM
Facility
Advanced
Data
Analytics
Special
Assessment
Management
Credit
Assessment
Suite
RRR
PDM – Probability of Default Microservice
Enriched
Facility
RRR
Patterns
• Design Patterns
• 23 stuks
• Enterprise Integration Patterns
• 65 stuks
Messaging Patterns
Und jetzt kommen die Kamele …
Apache Camel is:
• Open source lightweight Integration framework
• Library: .jar dependencies
camel-core.jar + .jar per component
• Gebaseerd op Enterprise Integration patterns
• Java,Groovy & Scala fluent DSL
• Versie 1.0 gepubliceerd in 2007, huidige versie: 2.20.3
• Integreert met Spring (-boot)
ApplicationContext  CamelContext
6
How do I get started with Apache Camel?
Apache Camel is easy,
just read this 912 page book ;)
Workshop van Ivo Woltring:
• https://github.com/Ordina-JTech/camel-workshop
Of deep-dive:
• http://camel.apache.org
Endpoint URI’s - Components
• http[s]://hostName[:port][/resourceUri][?options]
• bean:beanName[?options]
• consul:apiEndpoint[?options]
• direct:someName[?options]
• ejb:ejbName[?options]
• file://nameOfFileOrDirectory[?options]
• hipchat://[host][:port]?options
• jdbc:dataSourceName[?options]
• rest:verb:path[?options]
• validation:resourceName[?options]
Routes definieren tussen Endpoints
9
@Component
public class HelloRouteBuilder extends RouteBuilder {
@Override
public void configure() {
from("rest:get:hello:/{me}")
.transform().simple("Hi ${header.me}");
from("rest:post:hello")
.setHeader("subject", constant("Hello!"))
.to("smtp:admin@tempuri.com");
}
}
Exchange & Processor
• Exchange
• In(putMessage)
• Header
• Body
• Out(putMessage)
• Header
• Body
• Exception
• [tl;dr]
@Component
public class GetOrderProcessor implements Processor {
@Autowired CustomerOrderRepository repo;
public void process(Exchange exchg) {
Customer cust = exchg.getIn()
.getBody(Customer.class);
exchg.getOut()
.setBody(repo.findAll(cust.getId()));
}
}
@Autowired GetOrderProcessor getOrders
. . .
from("direct:getcustomerorders").process(getOrders);
VergelijkingCamel met Spring Integration
PDM – Camel kernel
from("direct:determine_pd")
.to("bean-validator:facility")
.log("Start PDM for facility id: ${body.facilityId}")
.to(MULTI_URI)
.log("--> CAS")
.to(CalculatePDClientAdapter.URI)
.log(" RRR = ${body.rabobankRiskRating}");
from(MULTI_URI)
.multicast(multiStrategy)
.stopOnException()
.parallelProcessing()
.to( AdaGetBehaviouralDataRoute.URI,
SamGetDpdInfoAdapter.URI,
SamGetFacilityDefaultStatusAdapter.URI)
.end();
PDM – SAM interconnection
@Value("${service.sam.getdpdinfourl}")
private String getDpdInfoUrl;
. . .
from(SamGetDpdInfoAdapter.URI)
.to(SamGetDpdInfoClient.URI)
.unmarshall().json(JsonLibrary.Jackson, DPDInfo.class);
from(SamGetDpdInfoClient.URI)
.setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
.setHeader(Exchange.HTTP_URI, simple(getDpdInfoUrl))
.to("https4:get");
Testing Camel routes
14
@RunWith(CamelSpringRunner.class)
public class SamGetDpdInfoAdapterTest {
@Produce(uri=TEST_START) ProducerTemplate samDpdInfoProducer;
@EndpointInject(uri=MOCK_RESULT) MockEndpoint resultEndpoint;
@TestConfiguration
public static class TestConfig extends SingleRouteCamelConfiguration {
@Override public RouteBuilder route() {
return () -> {
from(TEST_START).to(SamGetDpdInfoAdapter.URI).to(MOCK_RESULT);
}
}
}
@Test
public void test() {
resultEndpoint.expectedMessageCount(1);
resultEndpoint.allMessages().body(DPDInfo.class).isNotNull();
Facility facility = new Facility(“123”);
samDpdInfoProducer.sendBody(facility);
resultEndpoint.assertIsSatisfied();
}
}
Vragen ?
Bedankt voor jullie aandacht!

More Related Content

Similar to Brain bit camel

Data(?)Ops with CircleCI
Data(?)Ops with CircleCIData(?)Ops with CircleCI
Data(?)Ops with CircleCIJinwoong Kim
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated MLMark Tabladillo
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!netzwelt12345
 
Microservice message routing on Kubernetes
Microservice message routing on KubernetesMicroservice message routing on Kubernetes
Microservice message routing on KubernetesFrans van Buul
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferaydaveayan
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Pythondidip
 
Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Payara
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platformsPayara
 
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...Puppet
 
Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design PatternsBilgin Ibryam
 
AWS meetup「Apache Spark on EMR」
AWS meetup「Apache Spark on EMR」AWS meetup「Apache Spark on EMR」
AWS meetup「Apache Spark on EMR」SmartNews, Inc.
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Markus Eisele
 
Solving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelSolving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelChristian Posta
 
NET Libraries — Unlock Stunning Features Now
NET Libraries — Unlock Stunning Features NowNET Libraries — Unlock Stunning Features Now
NET Libraries — Unlock Stunning Features NowKaniVilas Technology
 
Google App Engine
Google App EngineGoogle App Engine
Google App EngineHung-yu Lin
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stackJohan Edstrom
 
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsBilgin Ibryam
 

Similar to Brain bit camel (20)

Windows Azure
Windows AzureWindows Azure
Windows Azure
 
Data(?)Ops with CircleCI
Data(?)Ops with CircleCIData(?)Ops with CircleCI
Data(?)Ops with CircleCI
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
Microservice message routing on Kubernetes
Microservice message routing on KubernetesMicroservice message routing on Kubernetes
Microservice message routing on Kubernetes
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferay
 
Os Solomon
Os SolomonOs Solomon
Os Solomon
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Python
 
Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
 
Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
 
AWS meetup「Apache Spark on EMR」
AWS meetup「Apache Spark on EMR」AWS meetup「Apache Spark on EMR」
AWS meetup「Apache Spark on EMR」
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Solving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache CamelSolving Enterprise Integration with Apache Camel
Solving Enterprise Integration with Apache Camel
 
NET Libraries — Unlock Stunning Features Now
NET Libraries — Unlock Stunning Features NowNET Libraries — Unlock Stunning Features Now
NET Libraries — Unlock Stunning Features Now
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Azure Service Fabric Mesh
Azure Service Fabric MeshAzure Service Fabric Mesh
Azure Service Fabric Mesh
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
 
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
 

More from Bert Koorengevel

Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
Ordina Accelerator program 2019 - Jenkins blue ocean pipelinesOrdina Accelerator program 2019 - Jenkins blue ocean pipelines
Ordina Accelerator program 2019 - Jenkins blue ocean pipelinesBert Koorengevel
 
Ordina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assuranceOrdina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assuranceBert Koorengevel
 
Ordina Accelerator program 2019 - Linux
Ordina Accelerator program 2019 - LinuxOrdina Accelerator program 2019 - Linux
Ordina Accelerator program 2019 - LinuxBert Koorengevel
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenBert Koorengevel
 
Ordina Accelerator program 2019 - DevOps CI-CD
Ordina Accelerator program 2019 - DevOps CI-CDOrdina Accelerator program 2019 - DevOps CI-CD
Ordina Accelerator program 2019 - DevOps CI-CDBert Koorengevel
 
Development Tools - Git SCM
Development Tools - Git SCMDevelopment Tools - Git SCM
Development Tools - Git SCMBert Koorengevel
 

More from Bert Koorengevel (7)

Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
Ordina Accelerator program 2019 - Jenkins blue ocean pipelinesOrdina Accelerator program 2019 - Jenkins blue ocean pipelines
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
 
Ordina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assuranceOrdina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assurance
 
Ordina Accelerator program 2019 - Linux
Ordina Accelerator program 2019 - LinuxOrdina Accelerator program 2019 - Linux
Ordina Accelerator program 2019 - Linux
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - Maven
 
Ordina Accelerator program 2019 - DevOps CI-CD
Ordina Accelerator program 2019 - DevOps CI-CDOrdina Accelerator program 2019 - DevOps CI-CD
Ordina Accelerator program 2019 - DevOps CI-CD
 
Development Tools - Maven
Development Tools - MavenDevelopment Tools - Maven
Development Tools - Maven
 
Development Tools - Git SCM
Development Tools - Git SCMDevelopment Tools - Git SCM
Development Tools - Git SCM
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Brain bit camel

  • 1. UseTest1 Probability of Default Microservice RHD BrainBit, 01-03-2018 Bert Koorengevel –The Commitments Und jetzt kommen die Kamele …
  • 2. Agenda • PDM – Enterprise Integration Patterns • Wat is Apache Camel? • Waarom gebruiken we Camel? • Zijn er alternatieven? • Hoe ziet een Camel project er uit?
  • 4. Patterns • Design Patterns • 23 stuks • Enterprise Integration Patterns • 65 stuks
  • 6. Und jetzt kommen die Kamele … Apache Camel is: • Open source lightweight Integration framework • Library: .jar dependencies camel-core.jar + .jar per component • Gebaseerd op Enterprise Integration patterns • Java,Groovy & Scala fluent DSL • Versie 1.0 gepubliceerd in 2007, huidige versie: 2.20.3 • Integreert met Spring (-boot) ApplicationContext  CamelContext 6
  • 7. How do I get started with Apache Camel? Apache Camel is easy, just read this 912 page book ;) Workshop van Ivo Woltring: • https://github.com/Ordina-JTech/camel-workshop Of deep-dive: • http://camel.apache.org
  • 8. Endpoint URI’s - Components • http[s]://hostName[:port][/resourceUri][?options] • bean:beanName[?options] • consul:apiEndpoint[?options] • direct:someName[?options] • ejb:ejbName[?options] • file://nameOfFileOrDirectory[?options] • hipchat://[host][:port]?options • jdbc:dataSourceName[?options] • rest:verb:path[?options] • validation:resourceName[?options]
  • 9. Routes definieren tussen Endpoints 9 @Component public class HelloRouteBuilder extends RouteBuilder { @Override public void configure() { from("rest:get:hello:/{me}") .transform().simple("Hi ${header.me}"); from("rest:post:hello") .setHeader("subject", constant("Hello!")) .to("smtp:admin@tempuri.com"); } }
  • 10. Exchange & Processor • Exchange • In(putMessage) • Header • Body • Out(putMessage) • Header • Body • Exception • [tl;dr] @Component public class GetOrderProcessor implements Processor { @Autowired CustomerOrderRepository repo; public void process(Exchange exchg) { Customer cust = exchg.getIn() .getBody(Customer.class); exchg.getOut() .setBody(repo.findAll(cust.getId())); } } @Autowired GetOrderProcessor getOrders . . . from("direct:getcustomerorders").process(getOrders);
  • 12. PDM – Camel kernel from("direct:determine_pd") .to("bean-validator:facility") .log("Start PDM for facility id: ${body.facilityId}") .to(MULTI_URI) .log("--> CAS") .to(CalculatePDClientAdapter.URI) .log(" RRR = ${body.rabobankRiskRating}"); from(MULTI_URI) .multicast(multiStrategy) .stopOnException() .parallelProcessing() .to( AdaGetBehaviouralDataRoute.URI, SamGetDpdInfoAdapter.URI, SamGetFacilityDefaultStatusAdapter.URI) .end();
  • 13. PDM – SAM interconnection @Value("${service.sam.getdpdinfourl}") private String getDpdInfoUrl; . . . from(SamGetDpdInfoAdapter.URI) .to(SamGetDpdInfoClient.URI) .unmarshall().json(JsonLibrary.Jackson, DPDInfo.class); from(SamGetDpdInfoClient.URI) .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET)) .setHeader(Exchange.HTTP_URI, simple(getDpdInfoUrl)) .to("https4:get");
  • 14. Testing Camel routes 14 @RunWith(CamelSpringRunner.class) public class SamGetDpdInfoAdapterTest { @Produce(uri=TEST_START) ProducerTemplate samDpdInfoProducer; @EndpointInject(uri=MOCK_RESULT) MockEndpoint resultEndpoint; @TestConfiguration public static class TestConfig extends SingleRouteCamelConfiguration { @Override public RouteBuilder route() { return () -> { from(TEST_START).to(SamGetDpdInfoAdapter.URI).to(MOCK_RESULT); } } } @Test public void test() { resultEndpoint.expectedMessageCount(1); resultEndpoint.allMessages().body(DPDInfo.class).isNotNull(); Facility facility = new Facility(“123”); samDpdInfoProducer.sendBody(facility); resultEndpoint.assertIsSatisfied(); } }
  • 15. Vragen ? Bedankt voor jullie aandacht!