SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
Performance Optimizations
    for Apache Camel
        Christian Müller
WARNING: Jetlagged!




        http://sav-cdn.com/sites/default/files/imagecache/superphoto/10718770.jpg
Agenda
    ●   Brief Introduction
    ●   Content based routing EIP (and XML)
    ●   Split EIP (and XML)
    ●   Marshaling / Unmarshaling
    ●   Working with files
    ●   Accessing databases
    ●   Working with threads()
    ●   Working with templates
    ●   Using Web Services
    ●   Messaging
    ●   Q&A
Brief introduction
●   11 years of experience in software
    development and architecture
    –   Focused on Java integration technologies
●   Senior Software Developer at Atos
    Worldline in Frankfurt, Germany
    –   Tech. responsible for our integration platform
        based on ServiceMix & Camel
●   Apache Camel committer and current PMC
    chair
    –   Partly involved in Apache Karaf, ServiceMix
Apache Camel 3.0
●   Be involved!
    –   irc://irc.codehaus.org/camel
    –   dev@camel.apache.org
    –   http://camel.465427.n5.nabble.com/Camel-
        Development-f479097.html
●   Share your ideas & wishes with us!
    –   http://camel.apache.org/camel-30-ideas.html
●   Be part of it!
    –   http://camel.apache.org/camel-30-roadmap.html
    –   http://camel.apache.org/contributing.html
Content based routing EIP
●   Demo
Content based routing EIP

                               Duration in ms to route 10.000 10 KByte messages


9000


8000


7000

                                                                                        XPath (JDK)
6000                                                                                    XPath (Saxon)
                                                                                        XQuery
5000                                                                                    VTDXML*
                                                                                        Simple
                                                                                        Header
4000


3000


2000


1000


   0
               8900     4500        3900          2600           600              500


       https://github.com/muellerc/apachecon-na-2013/tree/master/cbr-eip




                                                                                               * GPL
Conclusion
●   Prefer to use conditions based on your
    message header
●   Use String contains check, if it works for
    you (e.g. with Simple language)
●   Use VDTXML if possible (GPL license)
●   Use XQuery
●   If you (have to) use XPath, make sure you
    have Saxon in your class path.
Split EIP
●   Demo
Split EIP

              Duration in ms to split a 100 MByte message
                                                            Memory footprint in MByte to split a 100 MByte file


9000


8000


7000


6000                                                                                                              XPath (JDK)
                                                                                                                  XPath (Saxon)
5000                                                                                                              VTDXML*
                                                                                                                  XML Tokenizer

4000


3000


2000


1000


   0
             0       8800      5100      7400               1126       480        200         8


       https://github.com/muellerc/apachecon-na-2013/tree/master/split-eip




                                                                                                                         * GPL
Conclusion
●   Use VDTXML if possible (GPL license)
●   Prefer to use the XML Tokenizer (NS
    limitation)
●   If you (have to) use XPath, make sure you
    have Saxon in your class path.
     – Otherwise there is a good chance it will
       fail
Marshaling / Unmarshaling
●   Demo
Marshaling / Unmarshaling

                          Duration in ms to marshal and unmarshal 10.000 messages


5000

4500

4000

                                                                                              XStream (XML)
3500                                                                                          XMLBeans (XML)
                                                                                              JAXB (XML)
3000                                                                                          JIBX* (XML)
                                                                                              XStream (Json)
2500                                                                                          Gson (Json)
                                                                                              Jackson (Json)
2000                                                                                          Java Serialization


1500

1000

500

   0
            3100   2300    2200       1800       5000       1200       800          1100


       https://github.com/muellerc/apachecon-na-2013/tree/master/marshaling-unmarshaling




                                                                    * doesn't work with Java 7 in every case
Conclusion
●   Use JIBX for XML if possible (not Java 7
    ready at present)
●   Use JAXB for XML
●   Use Jackson for Json
●   Don't use Java serialization (not
    interoperable, not easy to read)
Working with files
●   Demo
Working with files

                          Duration in ms to write 50.000 lines a 140 Bytes into a file


18000


16000


14000


12000                                                                                    Line by Line
                                                                                         Aggregator (String)
                                                                                         Aggregator (StringBuilder)
10000                                                                                    Streaming
                                                                                         Aggregator (Build in)
8000


6000


4000


2000


   0
                 14400    17700           4300             4300            3200


        https://github.com/muellerc/apachecon-na-2013/tree/master/file-component
Conclusion
●   Use an Aggregator to reduce the number of
    file accesses (prefer the build in one)
●   Use a StringBuilder to concatenate Strings
Working with databases
●   Demo
Working with databases

                               Duration in ms to insert 10.000 records



3500


3000


2500
                                                                         Record by Record
                                                                         Batched (by 10 records)
2000                                                                     Batched (by 100 records)
                                                                         Batched (by 1000 records)

1500


1000


500


   0
                 3200       1400             1200              1100


       https://github.com/muellerc/apachecon-na-2013/tree/master/sql-component
Conclusion
●   Use an Aggregator to reduce the number of
    database accesses
Working with threads()
●   Demo
Working with threads()

                Duration in ms to process 1000 messages     Duration in ms to process 10 files


12000



10000



8000
                                                                                                 Single threaded processing
                                                                                                 Multi threaded processing (10)
6000



4000



2000



    0
                11400          1200                       10100         1100


        https://github.com/muellerc/apachecon-na-2013/tree/master/threads
Conclusion
●   Use threads to parallelize your work
Working with templates
●   Demo
Working with templates

                                  Duration in ms to process 10000 messages




3500


3000


2500
                                                                             String Template
                                                                             Velocity
2000                                                                         FreeMarker


1500


1000


500


  0                  3100            1200                  1000


       https://github.com/muellerc/apachecon-na-2013/tree/master/template
Conclusion
●   Prefer to use FreeMarker or Velocity
Using web services
●   Demo
Using web services

                               Duration in ms to send 10000 messages



30000



25000



20000                                                                     POJO (without Woodstox)
                                                                          POJO
                                                                          PAYLOAD
                                                                          MESSAGE
15000



10000



5000



   0
                   28300     26300          25400           23000


        https://github.com/muellerc/apachecon-na-2013/tree/master/cxf-component
Conclusion
●   Prefer to use the PAYLOAD or MESSAGE
    data format if you don't need a Java object
    (skip the Unmarshaler)
●   Fine tune you container (Jetty, Tomcat, …)
    to use the right settings for your needs
    (connector, acceptor, ...)
Messaging
●   Demo
Messaging

                                 Duration in ms to process 100 messages




6000



5000



4000                                                                         InOut perm. queue
                                                                             InOut temp. queue
                                                                             InOnly
3000



2000



1000



   0                 5600          5600                  1100


       https://github.com/muellerc/apachecon-na-2013/tree/master/jms-component
Messaging

                          Duration in ms to read and write 10000 messages



3500


3000


2500
                                                                            SJMS (Trans.)
                                                                            SJMS (Trans. Batch Consumer)
2000                                                                        SJMS (Trans. Batch)*


1500


1000


500


   0               3300           2500                2200


       https://github.com/muellerc/apachecon-na-2013/tree/master/sjms-component




                                                                             * could be improved
Conclusion
●   Prefer to use InOnly routes instead of InOut
    routes if possible
●   Use temp. reply queues or exclusive perm.
    reply queues if you have to use InOut
    routes
●   Acknowledge messages in batch mode
    (SJMS)
●   Use the batch message to reduce the
    number of broker accesses (SJMS)
Q&A

Weitere ähnliche Inhalte

Was ist angesagt?

My sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsLouis liu
 
PostgreSQL performance archaeology
PostgreSQL performance archaeologyPostgreSQL performance archaeology
PostgreSQL performance archaeologyTomas Vondra
 
Мониторинг. Опять, rootconf 2016
Мониторинг. Опять, rootconf 2016Мониторинг. Опять, rootconf 2016
Мониторинг. Опять, rootconf 2016Vsevolod Polyakov
 
MongoDB as Message Queue
MongoDB as Message QueueMongoDB as Message Queue
MongoDB as Message QueueMongoDB
 
Add a bit of ACID to Cassandra. Cassandra Summit EU 2014
Add a bit of ACID to Cassandra. Cassandra Summit EU 2014Add a bit of ACID to Cassandra. Cassandra Summit EU 2014
Add a bit of ACID to Cassandra. Cassandra Summit EU 2014odnoklassniki.ru
 
JVM performance options. How it works
JVM performance options. How it worksJVM performance options. How it works
JVM performance options. How it worksDmitriy Dumanskiy
 
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Ontico
 
Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018 Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018 Antonios Giannopoulos
 
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...DataStax Academy
 
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...Ontico
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioHajime Tazaki
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Ontico
 
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...Ontico
 
System Capa Planning_DBA oracle edu
System Capa Planning_DBA oracle eduSystem Capa Planning_DBA oracle edu
System Capa Planning_DBA oracle edu엑셈
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detailLouis liu
 

Was ist angesagt? (20)

My sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutions
 
PostgreSQL performance archaeology
PostgreSQL performance archaeologyPostgreSQL performance archaeology
PostgreSQL performance archaeology
 
Мониторинг. Опять, rootconf 2016
Мониторинг. Опять, rootconf 2016Мониторинг. Опять, rootconf 2016
Мониторинг. Опять, rootconf 2016
 
MongoDB as Message Queue
MongoDB as Message QueueMongoDB as Message Queue
MongoDB as Message Queue
 
Metrics: where and how
Metrics: where and howMetrics: where and how
Metrics: where and how
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
 
Add a bit of ACID to Cassandra. Cassandra Summit EU 2014
Add a bit of ACID to Cassandra. Cassandra Summit EU 2014Add a bit of ACID to Cassandra. Cassandra Summit EU 2014
Add a bit of ACID to Cassandra. Cassandra Summit EU 2014
 
JVM performance options. How it works
JVM performance options. How it worksJVM performance options. How it works
JVM performance options. How it works
 
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
 
MongoDB Replication Cluster
MongoDB Replication ClusterMongoDB Replication Cluster
MongoDB Replication Cluster
 
Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018 Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018
 
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
 
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osio
 
Thanos - Prometheus on Scale
Thanos - Prometheus on ScaleThanos - Prometheus on Scale
Thanos - Prometheus on Scale
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
 
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
 
System Capa Planning_DBA oracle edu
System Capa Planning_DBA oracle eduSystem Capa Planning_DBA oracle edu
System Capa Planning_DBA oracle edu
 
tdc2012
tdc2012tdc2012
tdc2012
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detail
 

Ähnlich wie Apache Con NA 2013

Squeak DBX
Squeak DBXSqueak DBX
Squeak DBXESUG
 
J Ruby Kungfu Rails
J Ruby   Kungfu RailsJ Ruby   Kungfu Rails
J Ruby Kungfu RailsDaniel Lv
 
Apache Camel K - Fredericia
Apache Camel K - FredericiaApache Camel K - Fredericia
Apache Camel K - FredericiaClaus Ibsen
 
Betting On Data Grids
Betting On Data GridsBetting On Data Grids
Betting On Data Gridsgojkoadzic
 
Tuning Solr for Logs: Presented by Radu Gheorghe, Sematext
Tuning Solr for Logs: Presented by Radu Gheorghe, SematextTuning Solr for Logs: Presented by Radu Gheorghe, Sematext
Tuning Solr for Logs: Presented by Radu Gheorghe, SematextLucidworks
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1Marco Gralike
 
Perf EMC VNX5100 vs IBM DS5300 Eng
Perf EMC VNX5100 vs IBM DS5300 EngPerf EMC VNX5100 vs IBM DS5300 Eng
Perf EMC VNX5100 vs IBM DS5300 EngOleg Korol
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
Running Presto and Spark on the Netflix Big Data Platform
Running Presto and Spark on the Netflix Big Data PlatformRunning Presto and Spark on the Netflix Big Data Platform
Running Presto and Spark on the Netflix Big Data PlatformEva Tse
 
(BDT303) Running Spark and Presto on the Netflix Big Data Platform
(BDT303) Running Spark and Presto on the Netflix Big Data Platform(BDT303) Running Spark and Presto on the Netflix Big Data Platform
(BDT303) Running Spark and Presto on the Netflix Big Data PlatformAmazon Web Services
 
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Claus Ibsen
 
Project Tungsten Phase II: Joining a Billion Rows per Second on a Laptop
Project Tungsten Phase II: Joining a Billion Rows per Second on a LaptopProject Tungsten Phase II: Joining a Billion Rows per Second on a Laptop
Project Tungsten Phase II: Joining a Billion Rows per Second on a LaptopDatabricks
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Claus Ibsen
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - CopenhagenClaus Ibsen
 
MongoDB: How it Works
MongoDB: How it WorksMongoDB: How it Works
MongoDB: How it WorksMike Dirolf
 
Spark Summit EU talk by Sameer Agarwal
Spark Summit EU talk by Sameer AgarwalSpark Summit EU talk by Sameer Agarwal
Spark Summit EU talk by Sameer AgarwalSpark Summit
 
Apache Camel v3, Camel K and Camel Quarkus
Apache Camel v3, Camel K and Camel QuarkusApache Camel v3, Camel K and Camel Quarkus
Apache Camel v3, Camel K and Camel QuarkusClaus Ibsen
 
HandlerSocket plugin Client for Javaとそれを用いたベンチマーク
HandlerSocket plugin Client for Javaとそれを用いたベンチマークHandlerSocket plugin Client for Javaとそれを用いたベンチマーク
HandlerSocket plugin Client for Javaとそれを用いたベンチマークmoai kids
 

Ähnlich wie Apache Con NA 2013 (20)

Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
J Ruby Kungfu Rails
J Ruby   Kungfu RailsJ Ruby   Kungfu Rails
J Ruby Kungfu Rails
 
Apache Camel K - Fredericia
Apache Camel K - FredericiaApache Camel K - Fredericia
Apache Camel K - Fredericia
 
Betting On Data Grids
Betting On Data GridsBetting On Data Grids
Betting On Data Grids
 
Tuning Solr for Logs: Presented by Radu Gheorghe, Sematext
Tuning Solr for Logs: Presented by Radu Gheorghe, SematextTuning Solr for Logs: Presented by Radu Gheorghe, Sematext
Tuning Solr for Logs: Presented by Radu Gheorghe, Sematext
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
 
Perf EMC VNX5100 vs IBM DS5300 Eng
Perf EMC VNX5100 vs IBM DS5300 EngPerf EMC VNX5100 vs IBM DS5300 Eng
Perf EMC VNX5100 vs IBM DS5300 Eng
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Running Presto and Spark on the Netflix Big Data Platform
Running Presto and Spark on the Netflix Big Data PlatformRunning Presto and Spark on the Netflix Big Data Platform
Running Presto and Spark on the Netflix Big Data Platform
 
(BDT303) Running Spark and Presto on the Netflix Big Data Platform
(BDT303) Running Spark and Presto on the Netflix Big Data Platform(BDT303) Running Spark and Presto on the Netflix Big Data Platform
(BDT303) Running Spark and Presto on the Netflix Big Data Platform
 
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
 
Project Tungsten Phase II: Joining a Billion Rows per Second on a Laptop
Project Tungsten Phase II: Joining a Billion Rows per Second on a LaptopProject Tungsten Phase II: Joining a Billion Rows per Second on a Laptop
Project Tungsten Phase II: Joining a Billion Rows per Second on a Laptop
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
 
MongoDB: How it Works
MongoDB: How it WorksMongoDB: How it Works
MongoDB: How it Works
 
Spark Summit EU talk by Sameer Agarwal
Spark Summit EU talk by Sameer AgarwalSpark Summit EU talk by Sameer Agarwal
Spark Summit EU talk by Sameer Agarwal
 
Apache Camel v3, Camel K and Camel Quarkus
Apache Camel v3, Camel K and Camel QuarkusApache Camel v3, Camel K and Camel Quarkus
Apache Camel v3, Camel K and Camel Quarkus
 
HandlerSocket plugin Client for Javaとそれを用いたベンチマーク
HandlerSocket plugin Client for Javaとそれを用いたベンチマークHandlerSocket plugin Client for Javaとそれを用いたベンチマーク
HandlerSocket plugin Client for Javaとそれを用いたベンチマーク
 

Kürzlich hochgeladen

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Kürzlich hochgeladen (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

Apache Con NA 2013

  • 1. Performance Optimizations for Apache Camel Christian Müller
  • 2. WARNING: Jetlagged! http://sav-cdn.com/sites/default/files/imagecache/superphoto/10718770.jpg
  • 3. Agenda ● Brief Introduction ● Content based routing EIP (and XML) ● Split EIP (and XML) ● Marshaling / Unmarshaling ● Working with files ● Accessing databases ● Working with threads() ● Working with templates ● Using Web Services ● Messaging ● Q&A
  • 4. Brief introduction ● 11 years of experience in software development and architecture – Focused on Java integration technologies ● Senior Software Developer at Atos Worldline in Frankfurt, Germany – Tech. responsible for our integration platform based on ServiceMix & Camel ● Apache Camel committer and current PMC chair – Partly involved in Apache Karaf, ServiceMix
  • 5. Apache Camel 3.0 ● Be involved! – irc://irc.codehaus.org/camel – dev@camel.apache.org – http://camel.465427.n5.nabble.com/Camel- Development-f479097.html ● Share your ideas & wishes with us! – http://camel.apache.org/camel-30-ideas.html ● Be part of it! – http://camel.apache.org/camel-30-roadmap.html – http://camel.apache.org/contributing.html
  • 6. Content based routing EIP ● Demo
  • 7. Content based routing EIP Duration in ms to route 10.000 10 KByte messages 9000 8000 7000 XPath (JDK) 6000 XPath (Saxon) XQuery 5000 VTDXML* Simple Header 4000 3000 2000 1000 0 8900 4500 3900 2600 600 500 https://github.com/muellerc/apachecon-na-2013/tree/master/cbr-eip * GPL
  • 8. Conclusion ● Prefer to use conditions based on your message header ● Use String contains check, if it works for you (e.g. with Simple language) ● Use VDTXML if possible (GPL license) ● Use XQuery ● If you (have to) use XPath, make sure you have Saxon in your class path.
  • 10. Split EIP Duration in ms to split a 100 MByte message Memory footprint in MByte to split a 100 MByte file 9000 8000 7000 6000 XPath (JDK) XPath (Saxon) 5000 VTDXML* XML Tokenizer 4000 3000 2000 1000 0 0 8800 5100 7400 1126 480 200 8 https://github.com/muellerc/apachecon-na-2013/tree/master/split-eip * GPL
  • 11. Conclusion ● Use VDTXML if possible (GPL license) ● Prefer to use the XML Tokenizer (NS limitation) ● If you (have to) use XPath, make sure you have Saxon in your class path. – Otherwise there is a good chance it will fail
  • 13. Marshaling / Unmarshaling Duration in ms to marshal and unmarshal 10.000 messages 5000 4500 4000 XStream (XML) 3500 XMLBeans (XML) JAXB (XML) 3000 JIBX* (XML) XStream (Json) 2500 Gson (Json) Jackson (Json) 2000 Java Serialization 1500 1000 500 0 3100 2300 2200 1800 5000 1200 800 1100 https://github.com/muellerc/apachecon-na-2013/tree/master/marshaling-unmarshaling * doesn't work with Java 7 in every case
  • 14. Conclusion ● Use JIBX for XML if possible (not Java 7 ready at present) ● Use JAXB for XML ● Use Jackson for Json ● Don't use Java serialization (not interoperable, not easy to read)
  • 16. Working with files Duration in ms to write 50.000 lines a 140 Bytes into a file 18000 16000 14000 12000 Line by Line Aggregator (String) Aggregator (StringBuilder) 10000 Streaming Aggregator (Build in) 8000 6000 4000 2000 0 14400 17700 4300 4300 3200 https://github.com/muellerc/apachecon-na-2013/tree/master/file-component
  • 17. Conclusion ● Use an Aggregator to reduce the number of file accesses (prefer the build in one) ● Use a StringBuilder to concatenate Strings
  • 19. Working with databases Duration in ms to insert 10.000 records 3500 3000 2500 Record by Record Batched (by 10 records) 2000 Batched (by 100 records) Batched (by 1000 records) 1500 1000 500 0 3200 1400 1200 1100 https://github.com/muellerc/apachecon-na-2013/tree/master/sql-component
  • 20. Conclusion ● Use an Aggregator to reduce the number of database accesses
  • 22. Working with threads() Duration in ms to process 1000 messages Duration in ms to process 10 files 12000 10000 8000 Single threaded processing Multi threaded processing (10) 6000 4000 2000 0 11400 1200 10100 1100 https://github.com/muellerc/apachecon-na-2013/tree/master/threads
  • 23. Conclusion ● Use threads to parallelize your work
  • 25. Working with templates Duration in ms to process 10000 messages 3500 3000 2500 String Template Velocity 2000 FreeMarker 1500 1000 500 0 3100 1200 1000 https://github.com/muellerc/apachecon-na-2013/tree/master/template
  • 26. Conclusion ● Prefer to use FreeMarker or Velocity
  • 28. Using web services Duration in ms to send 10000 messages 30000 25000 20000 POJO (without Woodstox) POJO PAYLOAD MESSAGE 15000 10000 5000 0 28300 26300 25400 23000 https://github.com/muellerc/apachecon-na-2013/tree/master/cxf-component
  • 29. Conclusion ● Prefer to use the PAYLOAD or MESSAGE data format if you don't need a Java object (skip the Unmarshaler) ● Fine tune you container (Jetty, Tomcat, …) to use the right settings for your needs (connector, acceptor, ...)
  • 31. Messaging Duration in ms to process 100 messages 6000 5000 4000 InOut perm. queue InOut temp. queue InOnly 3000 2000 1000 0 5600 5600 1100 https://github.com/muellerc/apachecon-na-2013/tree/master/jms-component
  • 32. Messaging Duration in ms to read and write 10000 messages 3500 3000 2500 SJMS (Trans.) SJMS (Trans. Batch Consumer) 2000 SJMS (Trans. Batch)* 1500 1000 500 0 3300 2500 2200 https://github.com/muellerc/apachecon-na-2013/tree/master/sjms-component * could be improved
  • 33. Conclusion ● Prefer to use InOnly routes instead of InOut routes if possible ● Use temp. reply queues or exclusive perm. reply queues if you have to use InOut routes ● Acknowledge messages in batch mode (SJMS) ● Use the batch message to reduce the number of broker accesses (SJMS)
  • 34. Q&A