SlideShare a Scribd company logo
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

More Related Content

What's hot

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
Louis liu
 
PostgreSQL performance archaeology
PostgreSQL performance archaeologyPostgreSQL performance archaeology
PostgreSQL performance archaeology
Tomas Vondra
 
Мониторинг. Опять, rootconf 2016
Мониторинг. Опять, rootconf 2016Мониторинг. Опять, rootconf 2016
Мониторинг. Опять, rootconf 2016
Vsevolod Polyakov
 
MongoDB as Message Queue
MongoDB as Message QueueMongoDB as Message Queue
MongoDB as Message Queue
MongoDB
 
Metrics: where and how
Metrics: where and howMetrics: where and how
Metrics: where and how
Vsevolod Polyakov
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
Anuchit Chalothorn
 
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
odnoklassniki.ru
 
JVM performance options. How it works
JVM performance options. How it worksJVM performance options. How it works
JVM performance options. How it works
Dmitriy Dumanskiy
 
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Ontico
 
MongoDB Replication Cluster
MongoDB Replication ClusterMongoDB Replication Cluster
MongoDB Replication Cluster
Anuchit Chalothorn
 
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 #osio
Hajime Tazaki
 
Thanos - Prometheus on Scale
Thanos - Prometheus on ScaleThanos - Prometheus on Scale
Thanos - Prometheus on Scale
Bartłomiej Płotka
 
Как понять, что происходит на сервере? / Александр Крижановский (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
엑셈
 
tdc2012
tdc2012tdc2012
tdc2012
Juan Lopes
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detail
Louis liu
 

What's hot (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
 

Similar to Apache Con NA 2013

Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
ESUG
 
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 - Fredericia
Claus Ibsen
 
Betting On Data Grids
Betting On Data GridsBetting On Data Grids
Betting On Data Grids
gojkoadzic
 
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
Lucidworks
 
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
 
Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
Amazon Web Services
 
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
Oleg Korol
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
Fabio 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 Platform
Eva 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 Platform
Amazon 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 Laptop
Databricks
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
Claus Ibsen
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
Claus Ibsen
 
MongoDB: How it Works
MongoDB: How it WorksMongoDB: How it Works
MongoDB: How it Works
Mike 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 Agarwal
Spark 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 Quarkus
Claus Ibsen
 
HandlerSocket plugin Client for Javaとそれを用いたベンチマーク
HandlerSocket plugin Client for Javaとそれを用いたベンチマークHandlerSocket plugin Client for Javaとそれを用いたベンチマーク
HandlerSocket plugin Client for Javaとそれを用いたベンチマークmoai kids
 

Similar to 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
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
 
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とそれを用いたベンチマーク
 

Recently uploaded

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).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