SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Using Apache Camel a bit like AKKA 
And debunking some SOA stuff 
Johan Edstrom 
SOA Executive and Apache developer. 
Apache Camel PMC 
Apache ServiceMix committer 
Original CXF Blueprint Author 
Cassandra client library developer 
Author 
jedstrom@savoirtech.com 
joed@apache.org
Savoir Technologies - This is where we started
Where are we now?
Well, what happened there? 
We kinda started focusing exclusively on scalability 
• We went from the majority of our customers wanting “ESB” 
• Or tune our “Messaging” 
To 
• Very modular software 
• Infrastructure design that would last a while 
• Key concept structures that were re-usable 
• We’ve gotten quite a bit of experience here over the years
So what is that scalability we talk of? 
The right resources in the right place 
• Tomcat doesn’t work better with 1024 threads 
Messaging 
 Writing QueueBrowsers to see where messages go isn’t awesome 
State driven - Not mentioned in EIP Patterns (Yet) 
Conversational - Not mentioned in EIP Patterns (Yet) 
Effectively aggregating - Don’t use a RDBMS as a mutex 
• select for update 2000 times a second doesn’t scale 
Transactionally safe - And that doesn’t have to mean XA 
Correctly utilizing EE 
• Connectionpools aren’t for cowards
This is what we are trying to avoid....
What is the AKKA statement?
So where does AKKA come in? 
It could be part of your deployment in Apache Karaf 
It could be stand-alone 
What is it that we really think is cool? 
• Asynchronous systems! 
• Actors 
• Supervisors 
• Scaling 
• Immutability 
Is that the goal for every Java shop out there?
So what does that AKKA look like?
Or maybe a bit more complicated? 
So what is going on here? 
• ActorSystem - umbrella naming 
• System bound error handling 
• Logging 
• Scaling 
• Then we introduce some EIP Patterns like “stuff” 
 We RoundRobin and allow it to scale 
 And we finally mount it
Are you trying to write Camel stuff? 
Sure 
• And yes I know that Camel-AKKA exists or is it AKKA-Camel now? 
• I know there is a Scala DSL for Camel - fixed a few things there… 
• What about the Scalaz stuff?
So…. That was really cool. But…. 
All projects aren’t greenfield 
• Can we refactor? 
We have existing staff and investments 
• Is it easy to train 
We want to do this in pieces 
• We really want to try, test, promote 
Could we do this with the existing EE Infra we have?
Let’s pretend you have Apache Karaf 
This is not far from an EE container 
• Add OpenEJB if you want and you’ll have a full stack 
It contains a web-services layer 
Dependency injection services 
OSGi integration and legacy (JBI) support (Don’t use that. - Seriously…) 
Camel for routing, transformation and mediation 
Aries and Spring for EE support, JNDI, TX, JPA 
Web-app deployment support
And we’ll add Apache ActiveMQ 
This is another presentation :) 
• Jeff did that one earlier today, I hope you did attend!
And I presume ya’ll know Apache Camel 
Camel is a Domain Specific Language (DSL) focused on 
implementing Enterprise Integration Patterns (EIPs) 
• Examples: multicast, splitter, content-based router, routing slip, “dynamic 
routers”, aggregator 
EIPs are implemented by Camel “Processors” 
• Users can develop their own processors 
• A processor is a fundamental building block 
• Bean language and bindings exists so that not a single piece of Apache Camel 
Imports will be necessary when integrating your existing code 
Camel can connect to a wide variety of integration technologies 
• Examples: JMS, HTTP, FTP, SOAP, File - There are ~ 180 components 
• Integrations are implemented by Camel “Components” 
• Users can develop their own components
Apache Camel
Do I need all of that? 
Nope, many solutions will need just a few things 
• jaxb, camel, jms, soap, rest and perhaps jdbc 
• Cut the container down to fit your needs 
• We don’t need to load all of the 100+ Apache Camel components 
• Pick and choose! 
Should I run that messaging solution inside the “ESB” 
• Entirely up to you, let us look a little deeper at that in a sec. 
Can I test these solutions or am I stuck with 
System.out.println and a remote debugger?
I’ve heard that OSGi sucks? 
Yes, It is a bit more complex to manage a full lifecycle 
• On the other hand you get reliable hot-deployment and things like 
configuration, service management and service subscriptions out of the box. 
Yes, package level import export can be confusing 
• So make sure you use packages in a nice modular way. 
Yes, it takes a while to learn the tooling 
• Then did you wake up one day just knowing that WAR or EAR layout? 
Yes, you need to learn the classpath and a bit about 
classloading 
• Which’ll make you a better developer in the end of the day. 
• Many problems in this area actually are created by applying EE classloaders 
to an OSGi environment.
Decoupling with OSGi 
Enforces knowledge of imports and exports 
Allows us to version 
Programming model with micro-services allows 
for re-use on an Api level vs code level 
Promotes contracts
Use case #1 
We want to accept incoming SOAP requests 
We need to inspect those HTTP headers and then use them 
to route 
We want this to be dynamic and flexible 
 We might want to add a more complex routing engine later 
We want this to be modular and possible to run across 
multiple systems
Verify your use-cases!
UseCase #1 outline 
Let us use some EIP pattern symbols to outline this 
• We haven’t really made any technology statements here 
 We are going to use Apache ActiveMQ because I said so. 
 It could easily have been any other JMS provider. 
• We know we’ll have a synchronous part 
 Web-services by nature are. 
• We’ll try and make all the other parts asynchronous 
• We’ll also make sure that the participants don’t need strong integration or 
visibility of each other, thus we’ll (hopefully) end up with some pretty re-usable 
modules 
• Another good approach is to also use sequence diagrams
What else do we want here? 
A “Dynamic” Router! 
• We’ll craft a simple header based Dynamic router from eip patterns. 
 Technically it is in between a routing slip with termination and a real 
control channel pattern, we utilize JMS as our control channel for this. 
 We use this example to play with destinations from SoapUI 
Remember that ActorSystem in AKKA? 
• This dynamic router is a big part of “pretending” that we are doing that
The “Dynamic Router” 
Yep, it is just a Java class. 
• Imagine how easily you could integrate this with.... Anything!
Why build that type of a route? 
We are able to turn “endpoints”, “routing”, “systems” or 
whatever you want to call it into simple destination names. 
We only need one route….. 
We can break all these modules apart
So let’s sum up what we have at this point 
We defined a CXF (JAX-WS) Endpoint, generated stubs and 
tied it into Camel 
• The MEP (Message Exchange Pattern) is IN/OUT since we use CXF 
We then dropped in a router “Our Dynamic Router” 
• It’ll listen to a JMS queue called recognizer 
• Then it’ll start inspecting headers for a location
What about that testing? 
We are going to be dealing with an OSGi environment. 
• Like an EE container it makes testing a tad less fun.... 
Full blown container testing with something like SoapUI 
• Can be scripted and automated in Maven 
• Or you could BDD / Cucumber script it 
Full OSGi tests with Pax-Exam 
• Allows you to wire up a full container 
Simple OSGi registry tests with PojoSr 
• Let’s you simulate an environment so you can test BluePrint! 
Functional Junit/TestNG tests with Camel-Test. 
• Should be combined with at least one of the above!
Testing the router 
First of, let us just do a Camel Test, we want to verify that 
the Dynamic routing works as expected. 
• As you can see, none of these routes know about each other. 
 And if you can’t see that, they still don't. 
Keep this 
in mind!!
How we’ll be using this dynamic data 
We basically can use this to write completely dynamic steps 
that will restart on a configuration change from 
• File changes 
• Code changes 
• JMX changes
Proof of concept outline 
We now have the following modules 
• customer-service : A model library 
• customer-service-ws : The webservices endpoint 
• dynamic-routing : A generic module for routing 
• response-builder : A simple module that returns a payload 
• That means that all of the needed patterns are fulfilled. 
• Competing consumer is a natural thing in JMS - KACHIIIIING!!!! 
• Eventing is a natural part of Apache Camel - KACHIIIIING!!!! 
• Request Reply is “Handled for us” - KACHIIIIING!!!! 
• Dynamic config - KACHIIIIING!!!! 
•
So why didn’t we just slap a camel route in 
Tomcat? 
That’s why.
Otay - so what the heck did that have to do with 
AKKA 
I’m glad you asked! 
• We have, thanks to putting it on ActiveMQ 
 Immutability 
 Scalability 
 Asynchronous behavior 
• We have a separation of Concerns - Kinda like the Actor 
 Are we really there tough? 
• Not yet!
Do we think we can make that “Actor” 
Lets make it very generic 
Lets make it really dynamic 
Lets use the power of OSGi to “do stuff” 
The basic premise now is - 
• JMS is our “Actor System” 
• Camel handles Messaging and in/out for us as well as a lot of nice to have 
stuff like errorhandling, graceful shutdown, startup, validation and so on. 
• We want a “generic” way of handling say… Objects?
Second use-case!!! 
We are gonna take what we learned and build parts of a 
dynamic ETL system - Basically CSV files
What is a mutator in this ETL system?
And how is it working? 
Yey! We are manipulating strings! 
• OMG, Such data…. 
• Kidding aside - we now have a tool where all the transformations can be 
described, this system contains OGNL, pattern matchers, regular expression 
engines and as we can see the MutationConfig contains factories for invoking 
these guys.
Lets stick these in Camel (MutationManager)
See that Supervisor destination? 
The “brian” of the whole system. 
• Checks if this is an initial record 
• Checks if there is pre-cleansing needed 
• Then goes onto in some sub-processors talking to rules and persistence to 
build a chain of MutationSets
Then we add an OSGi - Manager 
(ServiceFactory)
This is purely config driven in OSGi
And the Master system initiation
And showing all the moving parts
Running the system
How did it get to Mock? 
System wide “Role” for that particular incoming source file 
was established, it was added last in line. 
The roles are just written to a Cassandra layer, the 
supervisor and the MutationManager executes them.
And the operations? 
Runtime loaded 
• Part of a config chain - Applied as roles in a processing chain 
• Processing chain determined from config and built by the ServiceManager(s) 
• Can be hot deployed and loaded 
• Can be changed on running processing
End result? 
100% Event driven 
100% Asynchronous 
No camel knowledge really needed 
Competing consumer - Horizontally scalable 
Hot-Deployable 
• And most of the cool stuff I can’t even show you….. 
• This pattern is quite well documented in OSGi, not that often combined with 
Camel but you end up with all of the parts that really are interesting in 
something like AKKA
And what else is Savoir doing? 
https://github.com/savoirtech/aetos 
• Cooler than Karaf :) 
https://github.com/savoirtech/hecate 
• Hector based Pojo Mapper 
 Object Graph 
 Annotations 
• CQL3 based Pojo Mapper 
 Object Graph 
 Annotations 
 True collection handling 
 column adapters 
https://github.com/seijoed/hazelcast-discovery 
• HazelCast based ActiveMq discovery system
We might be releasing 
Polymorphic CRUD 
• Based on CXF 
• Fully Cassandra (or whatever) backed 
• Event driven 
• Single bean wiring with entity Class
And we might be looking more at AKKA :)
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Apache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationApache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationClaus Ibsen
 
Using Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityUsing Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityClaus Ibsen
 
Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Claus Ibsen
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache CamelKenneth Peeples
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration libraryClaus Ibsen
 
Microservices with apache_camel_barcelona
Microservices with apache_camel_barcelonaMicroservices with apache_camel_barcelona
Microservices with apache_camel_barcelonaClaus Ibsen
 
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Claus Ibsen
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersClaus Ibsen
 
Getting started with Apache Camel - jDays 2013
Getting started with Apache Camel - jDays 2013Getting started with Apache Camel - jDays 2013
Getting started with Apache Camel - jDays 2013Claus Ibsen
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache CamelClaus Ibsen
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldKonrad Malawski
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - CopenhagenClaus Ibsen
 
ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryClaus Ibsen
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Matt Raible
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache CamelFuseSource.com
 
State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)Claus Ibsen
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the WildTomer Gabel
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersClaus Ibsen
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A RideBruce Snyder
 
Apache Camel K - Fredericia
Apache Camel K - FredericiaApache Camel K - Fredericia
Apache Camel K - FredericiaClaus Ibsen
 

Was ist angesagt? (20)

Apache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationApache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentation
 
Using Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityUsing Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivity
 
Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache Camel
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration library
 
Microservices with apache_camel_barcelona
Microservices with apache_camel_barcelonaMicroservices with apache_camel_barcelona
Microservices with apache_camel_barcelona
 
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Getting started with Apache Camel - jDays 2013
Getting started with Apache Camel - jDays 2013Getting started with Apache Camel - jDays 2013
Getting started with Apache Camel - jDays 2013
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
 
ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration library
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A Ride
 
Apache Camel K - Fredericia
Apache Camel K - FredericiaApache Camel K - Fredericia
Apache Camel K - Fredericia
 

Ähnlich wie Using Apache Camel as AKKA

Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stackJohan Edstrom
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmersTamas Rev
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentationlalitjangra9
 
Are you new to Apache Camel
Are you new to Apache CamelAre you new to Apache Camel
Are you new to Apache Camelgnanagurus
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
 
Apache Camel interview Questions and Answers
Apache Camel interview Questions and AnswersApache Camel interview Questions and Answers
Apache Camel interview Questions and Answersjeetendra mandal
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangPaweł Pikuła
 
Scala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macrosScala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macrosebiznext
 
Why real integration developers ride Camels
Why real integration developers ride CamelsWhy real integration developers ride Camels
Why real integration developers ride CamelsChristian Posta
 
Apache Camel with Spring boot
Apache Camel with Spring bootApache Camel with Spring boot
Apache Camel with Spring bootKnoldus Inc.
 
Apache Camel with Spring boot
Apache Camel with Spring bootApache Camel with Spring boot
Apache Camel with Spring bootKnoldus Inc.
 
Immutable infrastructure isn’t the answer
Immutable infrastructure isn’t the answerImmutable infrastructure isn’t the answer
Immutable infrastructure isn’t the answerSam Bashton
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesHiroshi SHIBATA
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matterTomas Doran
 

Ähnlich wie Using Apache Camel as AKKA (20)

Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
Are you new to Apache Camel
Are you new to Apache CamelAre you new to Apache Camel
Are you new to Apache Camel
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Apache Camel interview Questions and Answers
Apache Camel interview Questions and AnswersApache Camel interview Questions and Answers
Apache Camel interview Questions and Answers
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old Erlang
 
Java 9, JShell, and Modularity
Java 9, JShell, and ModularityJava 9, JShell, and Modularity
Java 9, JShell, and Modularity
 
Scala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macrosScala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macros
 
Making Apache Camel work for you
Making Apache Camel work for you Making Apache Camel work for you
Making Apache Camel work for you
 
Why real integration developers ride Camels
Why real integration developers ride CamelsWhy real integration developers ride Camels
Why real integration developers ride Camels
 
Apache Camel with Spring boot
Apache Camel with Spring bootApache Camel with Spring boot
Apache Camel with Spring boot
 
Apache Camel with Spring boot
Apache Camel with Spring bootApache Camel with Spring boot
Apache Camel with Spring boot
 
Immutable infrastructure isn’t the answer
Immutable infrastructure isn’t the answerImmutable infrastructure isn’t the answer
Immutable infrastructure isn’t the answer
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutes
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
 

Kürzlich hochgeladen

Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...Henrik Hanke
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxAsifArshad8
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SESaleh Ibne Omar
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxRoquia Salam
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEMCharmi13
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this periodSaraIsabelJimenez
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerkumenegertelayegrama
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...university
 

Kürzlich hochgeladen (19)

Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SE
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptx
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEM
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this period
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeeger
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
 

Using Apache Camel as AKKA

  • 1. Using Apache Camel a bit like AKKA And debunking some SOA stuff Johan Edstrom SOA Executive and Apache developer. Apache Camel PMC Apache ServiceMix committer Original CXF Blueprint Author Cassandra client library developer Author jedstrom@savoirtech.com joed@apache.org
  • 2. Savoir Technologies - This is where we started
  • 4. Well, what happened there? We kinda started focusing exclusively on scalability • We went from the majority of our customers wanting “ESB” • Or tune our “Messaging” To • Very modular software • Infrastructure design that would last a while • Key concept structures that were re-usable • We’ve gotten quite a bit of experience here over the years
  • 5. So what is that scalability we talk of? The right resources in the right place • Tomcat doesn’t work better with 1024 threads Messaging  Writing QueueBrowsers to see where messages go isn’t awesome State driven - Not mentioned in EIP Patterns (Yet) Conversational - Not mentioned in EIP Patterns (Yet) Effectively aggregating - Don’t use a RDBMS as a mutex • select for update 2000 times a second doesn’t scale Transactionally safe - And that doesn’t have to mean XA Correctly utilizing EE • Connectionpools aren’t for cowards
  • 6. This is what we are trying to avoid....
  • 7. What is the AKKA statement?
  • 8. So where does AKKA come in? It could be part of your deployment in Apache Karaf It could be stand-alone What is it that we really think is cool? • Asynchronous systems! • Actors • Supervisors • Scaling • Immutability Is that the goal for every Java shop out there?
  • 9. So what does that AKKA look like?
  • 10. Or maybe a bit more complicated? So what is going on here? • ActorSystem - umbrella naming • System bound error handling • Logging • Scaling • Then we introduce some EIP Patterns like “stuff”  We RoundRobin and allow it to scale  And we finally mount it
  • 11. Are you trying to write Camel stuff? Sure • And yes I know that Camel-AKKA exists or is it AKKA-Camel now? • I know there is a Scala DSL for Camel - fixed a few things there… • What about the Scalaz stuff?
  • 12. So…. That was really cool. But…. All projects aren’t greenfield • Can we refactor? We have existing staff and investments • Is it easy to train We want to do this in pieces • We really want to try, test, promote Could we do this with the existing EE Infra we have?
  • 13. Let’s pretend you have Apache Karaf This is not far from an EE container • Add OpenEJB if you want and you’ll have a full stack It contains a web-services layer Dependency injection services OSGi integration and legacy (JBI) support (Don’t use that. - Seriously…) Camel for routing, transformation and mediation Aries and Spring for EE support, JNDI, TX, JPA Web-app deployment support
  • 14. And we’ll add Apache ActiveMQ This is another presentation :) • Jeff did that one earlier today, I hope you did attend!
  • 15. And I presume ya’ll know Apache Camel Camel is a Domain Specific Language (DSL) focused on implementing Enterprise Integration Patterns (EIPs) • Examples: multicast, splitter, content-based router, routing slip, “dynamic routers”, aggregator EIPs are implemented by Camel “Processors” • Users can develop their own processors • A processor is a fundamental building block • Bean language and bindings exists so that not a single piece of Apache Camel Imports will be necessary when integrating your existing code Camel can connect to a wide variety of integration technologies • Examples: JMS, HTTP, FTP, SOAP, File - There are ~ 180 components • Integrations are implemented by Camel “Components” • Users can develop their own components
  • 17. Do I need all of that? Nope, many solutions will need just a few things • jaxb, camel, jms, soap, rest and perhaps jdbc • Cut the container down to fit your needs • We don’t need to load all of the 100+ Apache Camel components • Pick and choose! Should I run that messaging solution inside the “ESB” • Entirely up to you, let us look a little deeper at that in a sec. Can I test these solutions or am I stuck with System.out.println and a remote debugger?
  • 18. I’ve heard that OSGi sucks? Yes, It is a bit more complex to manage a full lifecycle • On the other hand you get reliable hot-deployment and things like configuration, service management and service subscriptions out of the box. Yes, package level import export can be confusing • So make sure you use packages in a nice modular way. Yes, it takes a while to learn the tooling • Then did you wake up one day just knowing that WAR or EAR layout? Yes, you need to learn the classpath and a bit about classloading • Which’ll make you a better developer in the end of the day. • Many problems in this area actually are created by applying EE classloaders to an OSGi environment.
  • 19. Decoupling with OSGi Enforces knowledge of imports and exports Allows us to version Programming model with micro-services allows for re-use on an Api level vs code level Promotes contracts
  • 20. Use case #1 We want to accept incoming SOAP requests We need to inspect those HTTP headers and then use them to route We want this to be dynamic and flexible  We might want to add a more complex routing engine later We want this to be modular and possible to run across multiple systems
  • 22. UseCase #1 outline Let us use some EIP pattern symbols to outline this • We haven’t really made any technology statements here  We are going to use Apache ActiveMQ because I said so.  It could easily have been any other JMS provider. • We know we’ll have a synchronous part  Web-services by nature are. • We’ll try and make all the other parts asynchronous • We’ll also make sure that the participants don’t need strong integration or visibility of each other, thus we’ll (hopefully) end up with some pretty re-usable modules • Another good approach is to also use sequence diagrams
  • 23. What else do we want here? A “Dynamic” Router! • We’ll craft a simple header based Dynamic router from eip patterns.  Technically it is in between a routing slip with termination and a real control channel pattern, we utilize JMS as our control channel for this.  We use this example to play with destinations from SoapUI Remember that ActorSystem in AKKA? • This dynamic router is a big part of “pretending” that we are doing that
  • 24. The “Dynamic Router” Yep, it is just a Java class. • Imagine how easily you could integrate this with.... Anything!
  • 25. Why build that type of a route? We are able to turn “endpoints”, “routing”, “systems” or whatever you want to call it into simple destination names. We only need one route….. We can break all these modules apart
  • 26. So let’s sum up what we have at this point We defined a CXF (JAX-WS) Endpoint, generated stubs and tied it into Camel • The MEP (Message Exchange Pattern) is IN/OUT since we use CXF We then dropped in a router “Our Dynamic Router” • It’ll listen to a JMS queue called recognizer • Then it’ll start inspecting headers for a location
  • 27. What about that testing? We are going to be dealing with an OSGi environment. • Like an EE container it makes testing a tad less fun.... Full blown container testing with something like SoapUI • Can be scripted and automated in Maven • Or you could BDD / Cucumber script it Full OSGi tests with Pax-Exam • Allows you to wire up a full container Simple OSGi registry tests with PojoSr • Let’s you simulate an environment so you can test BluePrint! Functional Junit/TestNG tests with Camel-Test. • Should be combined with at least one of the above!
  • 28. Testing the router First of, let us just do a Camel Test, we want to verify that the Dynamic routing works as expected. • As you can see, none of these routes know about each other.  And if you can’t see that, they still don't. Keep this in mind!!
  • 29. How we’ll be using this dynamic data We basically can use this to write completely dynamic steps that will restart on a configuration change from • File changes • Code changes • JMX changes
  • 30. Proof of concept outline We now have the following modules • customer-service : A model library • customer-service-ws : The webservices endpoint • dynamic-routing : A generic module for routing • response-builder : A simple module that returns a payload • That means that all of the needed patterns are fulfilled. • Competing consumer is a natural thing in JMS - KACHIIIIING!!!! • Eventing is a natural part of Apache Camel - KACHIIIIING!!!! • Request Reply is “Handled for us” - KACHIIIIING!!!! • Dynamic config - KACHIIIIING!!!! •
  • 31. So why didn’t we just slap a camel route in Tomcat? That’s why.
  • 32. Otay - so what the heck did that have to do with AKKA I’m glad you asked! • We have, thanks to putting it on ActiveMQ  Immutability  Scalability  Asynchronous behavior • We have a separation of Concerns - Kinda like the Actor  Are we really there tough? • Not yet!
  • 33. Do we think we can make that “Actor” Lets make it very generic Lets make it really dynamic Lets use the power of OSGi to “do stuff” The basic premise now is - • JMS is our “Actor System” • Camel handles Messaging and in/out for us as well as a lot of nice to have stuff like errorhandling, graceful shutdown, startup, validation and so on. • We want a “generic” way of handling say… Objects?
  • 34. Second use-case!!! We are gonna take what we learned and build parts of a dynamic ETL system - Basically CSV files
  • 35. What is a mutator in this ETL system?
  • 36. And how is it working? Yey! We are manipulating strings! • OMG, Such data…. • Kidding aside - we now have a tool where all the transformations can be described, this system contains OGNL, pattern matchers, regular expression engines and as we can see the MutationConfig contains factories for invoking these guys.
  • 37. Lets stick these in Camel (MutationManager)
  • 38. See that Supervisor destination? The “brian” of the whole system. • Checks if this is an initial record • Checks if there is pre-cleansing needed • Then goes onto in some sub-processors talking to rules and persistence to build a chain of MutationSets
  • 39. Then we add an OSGi - Manager (ServiceFactory)
  • 40. This is purely config driven in OSGi
  • 41. And the Master system initiation
  • 42. And showing all the moving parts
  • 44. How did it get to Mock? System wide “Role” for that particular incoming source file was established, it was added last in line. The roles are just written to a Cassandra layer, the supervisor and the MutationManager executes them.
  • 45. And the operations? Runtime loaded • Part of a config chain - Applied as roles in a processing chain • Processing chain determined from config and built by the ServiceManager(s) • Can be hot deployed and loaded • Can be changed on running processing
  • 46. End result? 100% Event driven 100% Asynchronous No camel knowledge really needed Competing consumer - Horizontally scalable Hot-Deployable • And most of the cool stuff I can’t even show you….. • This pattern is quite well documented in OSGi, not that often combined with Camel but you end up with all of the parts that really are interesting in something like AKKA
  • 47. And what else is Savoir doing? https://github.com/savoirtech/aetos • Cooler than Karaf :) https://github.com/savoirtech/hecate • Hector based Pojo Mapper  Object Graph  Annotations • CQL3 based Pojo Mapper  Object Graph  Annotations  True collection handling  column adapters https://github.com/seijoed/hazelcast-discovery • HazelCast based ActiveMq discovery system
  • 48. We might be releasing Polymorphic CRUD • Based on CXF • Fully Cassandra (or whatever) backed • Event driven • Single bean wiring with entity Class
  • 49. And we might be looking more at AKKA :)

Hinweis der Redaktion

  1. These systems are generally not the traditional three tier system (Web, Middleware, Database). There is a large ecosystem of projects providing COTS components to build applications. One ecosystem is centered around Apache Projects.
  2. Enterprise Integration Patterns