{"id":16737,"date":"2013-08-28T16:00:54","date_gmt":"2013-08-28T13:00:54","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=16737"},"modified":"2013-08-28T12:28:01","modified_gmt":"2013-08-28T09:28:01","slug":"getting-started-with-apache-camel-using-java","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html","title":{"rendered":"Getting started with Apache Camel using Java"},"content":{"rendered":"<p>Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many different protocols such as between VM, HTTP, FTP, JMS, or even DIRECTORY\/FILE, and yet still keep your processing code free of transport logic. This allows you to concentrate on digesting the content of the messages instead.<\/p>\n<p>Here I will provide a tutorial on how you can get started with Apache Camel using Java instead of <a href=\"http:\/\/saltnlight5.blogspot.com\/2012\/08\/getting-started-with-apache-camel-using.html\">Groovy<\/a>.<\/p>\n<p>Let\u2019s start by creating a Maven project <code>pom.xml<\/code> file first.<br \/>\n&nbsp;<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"\r\n        http:\/\/maven.apache.org\/POM\/4.0.0\r\n        http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n    &lt;groupId&gt;camel-spring-demo&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;camel-spring-demo&lt;\/artifactId&gt;\r\n    &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\r\n\r\n    &lt;properties&gt;\r\n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n        &lt;camel.version&gt;2.11.1&lt;\/camel.version&gt;\r\n    &lt;\/properties&gt;\r\n\r\n    &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.apache.camel&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;camel-core&lt;\/artifactId&gt;\r\n            &lt;version&gt;${camel.version}&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.slf4j&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;slf4j-simple&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.7.5&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n\r\n&lt;\/project&gt;<\/pre>\n<p>We are only going to explore the <code>camel-core<\/code>, which actually contains quite of few useful components that you may use. Also for logging purpose, I have added a <code>slf4j-simple<\/code> as <a href=\"http:\/\/saltnlight5.blogspot.com\/2013\/08\/how-to-configure-slf4j-with-different.html\">a logger implementation<\/a> so we may see output on console.<\/p>\n<p>Next you just need a class to construct an <code>Route<\/code>. A <code>Route<\/code> is like a instruction definition to Camel on how to move your messages from one point to another. We are going to create <code>src\/main\/java\/camelcoredemo\/TimerRouteBuilder.java<\/code> file that will generate a timer message on every second, and then pass to a processor that simply logs it.<\/p>\n<pre class=\" brush:java\">package camelcoredemo;\r\n\r\nimport org.slf4j.*;\r\nimport org.apache.camel.*;\r\nimport org.apache.camel.builder.*;\r\n\r\npublic class TimerRouteBuilder extends RouteBuilder {\r\n    static Logger LOG = LoggerFactory.getLogger(TimerRouteBuilder.class);\r\n    public void configure() {\r\n        from(\"timer:\/\/timer1?period=1000\")\r\n        .process(new Processor() {\r\n            public void process(Exchange msg) {\r\n                LOG.info(\"Processing {}\", msg);\r\n            }\r\n        });\r\n    }\r\n}<\/pre>\n<p>That\u2019s all you needed to get started. Now you may build and run this simple demo.<\/p>\n<pre class=\" brush:bash\">bash&gt; mvn compile\r\nbash&gt; mvn exec:java -Dexec.mainClass=org.apache.camel.main.Main -Dexec.args='-r camelcoredemo.TimerRouteBuilder'<\/pre>\n<p>Notice that we didn\u2019t even write a Java <strong>main<\/strong> class, but simply use the <code>org.apache.camel.main.Main<\/code> option to accepts a <code>RouteBuilder<\/code> class name as parameter. Then it will load and create the route automatically.<\/p>\n<h2>Controlling the <code>CamelContext<\/code><\/h2>\n<p>When you start Camel, it creates a <code>CamelContext<\/code> object that holds many information on how to run it, including the definition of the <code>Route<\/code> we created. Now if you want to have more control over this <code>CamelContext<\/code>, then you would need to write your own <code>Main<\/code> class. I will show you a simple one here.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">package camelcoredemo;\r\n\r\nimport org.slf4j.*;\r\nimport org.apache.camel.*;\r\nimport org.apache.camel.impl.*;\r\nimport org.apache.camel.builder.*;\r\n\r\npublic class TimerMain {\r\n    static Logger LOG = LoggerFactory.getLogger(TimerMain.class);\r\n    public static void main(String[] args) throws Exception {\r\n        new TimerMain().run();\r\n    }\r\n    void run() throws Exception {\r\n        final CamelContext camelContext = new DefaultCamelContext();\r\n        camelContext.addRoutes(createRouteBuilder());\r\n        camelContext.setTracing(true);\r\n        camelContext.start();\r\n\r\n        Runtime.getRuntime().addShutdownHook(new Thread() {\r\n            public void run() {\r\n                try {\r\n                    camelContext.stop();\r\n                } catch (Exception e) {\r\n                    throw new RuntimeException(e);\r\n                }\r\n            }\r\n        });\r\n\r\n        waitForStop();\r\n    }\r\n    RouteBuilder createRouteBuilder() {\r\n        return new TimerRouteBuilder();\r\n    }\r\n    void waitForStop() {\r\n        while (true) {\r\n            try {\r\n                Thread.sleep(Long.MAX_VALUE);\r\n            } catch (InterruptedException e) {\r\n                break;\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>As you can see, we re-used the existing <code>TimerRouteBuilder<\/code> class inside <code>createRouteBuilder()<\/code> method. Our <code>Main<\/code> class now have full control when to create, start and stop the <a href=\"http:\/\/camel.apache.org\/maven\/current\/camel-core\/apidocs\/org\/apache\/camel\/CamelContext.html\"><code>CamelContext<\/code><\/a>. This context allow you to have control on how to configure Camel globally rather than on <code>Route<\/code> level. The javadoc link gives all the setter methods that you can explore on what it can do.<\/p>\n<p>Noticed that we also need to provide few setup codes in our <code>Main<\/code> class. First we need to handle graceful shutdown, so we added a Java shutdown hook to invoke the context <code>stop()<\/code>. Secondly we need to add a thread block after context has started. The reason for this is that the <code>CamelContext#start()<\/code> method is non-blocking! If you don\u2019t block your <code>Main<\/code> thread after start, then it will simply exit right after it, which will have not much use. You want to run Camel as a service (like a server) until you explicitly press <code>CTRL+C<\/code> to terminate the process.<\/p>\n<h2>Improving the <code>Main<\/code> class to start <code>CamelContext<\/code><\/h2>\n<p>If you don\u2019t want to deal with much of the <code>Main<\/code> class setup code such as above, then you may simply extends the <code>org.apache.camel.main.Main<\/code> class provided by <code>camel-core<\/code> intead. By piggy-back on this class, you will only not have your Context auto setup, but you will get all the additional command line features such as controlling how long to run the process for, enabling tracing, loading custom route class etc.<\/p>\n<p>Refactoring previous example, here is how it look like.<\/p>\n<pre class=\" brush:java\">package camelcoredemo;\r\n\r\nimport org.slf4j.*;\r\nimport org.apache.camel.builder.*;\r\nimport org.apache.camel.main.Main;\r\n\r\npublic class TimerMain2 extends Main {\r\n    static Logger LOG = LoggerFactory.getLogger(TimerMain2.class);\r\n    public static void main(String[] args) throws Exception {\r\n        TimerMain2 main = new TimerMain2();\r\n        main.enableHangupSupport();\r\n        main.addRouteBuilder(createRouteBuilder());\r\n        main.run(args);\r\n    }\r\n    static RouteBuilder createRouteBuilder() {\r\n        return new TimerRouteBuilder();\r\n    }\r\n}<\/pre>\n<p>Now our <code>TimerMain2<\/code> is much shorter, and you may try it out and it should function the same as before.<\/p>\n<pre class=\" brush:bash\">bash&gt; mvn compile\r\nbash&gt; mvn exec:java -Dexec.mainClass=camelcoredemo.TimerMain2 -Dexec.args='-t'<\/pre>\n<p>Notice that we have given <code>-t<\/code> option and it will dump <code>Route<\/code> tracing. Use <code>-h<\/code> and you will see all the available options.<\/p>\n<h2>Adding bean to the Camel <code>Registry<\/code><\/h2>\n<p>In the <code>TimerRouteBuilder<\/code> example above, we have created a <code>Processor<\/code> on the fly. Now if you were to combine few different <code>Processor<\/code> together, it would be nicer to minimize the noise. Camel allow you to do this by registering processing beans in their registry space, and then you simply reference them in your route as <code>bean<\/code> component. Here is how I can convert above example into beans processing.<\/p>\n<pre class=\" brush:java\">package camelcoredemo;\r\n\r\nimport org.slf4j.*;\r\nimport org.apache.camel.*;\r\nimport org.apache.camel.builder.*;\r\nimport org.apache.camel.main.Main;\r\n\r\npublic class TimerBeansMain extends Main {\r\n    static Logger LOG = LoggerFactory.getLogger(TimerBeansMain.class);\r\n    public static void main(String[] args) throws Exception {\r\n        TimerBeansMain main = new TimerBeansMain();\r\n        main.enableHangupSupport();\r\n        main.bind(\"processByBean1\", new Bean1());\r\n        main.bind(\"processAgainByBean2\", new Bean2());\r\n        main.addRouteBuilder(createRouteBuilder());\r\n        main.run(args);\r\n    }\r\n    static RouteBuilder createRouteBuilder() {\r\n        return new RouteBuilder() {\r\n                public void configure() {\r\n                    from(\"timer:\/\/timer1?period=1000\")\r\n                    .to(\"bean:processByBean1\")\r\n                    .to(\"bean:processAgainByBean2\");\r\n                }\r\n            };\r\n    }\r\n\r\n    \/\/ Processor beans\r\n    static class Bean1 implements Processor {\r\n        public void process(Exchange msg) {\r\n            LOG.info(\"First process {}\", msg);\r\n        }\r\n    }\r\n    static class Bean2 implements Processor {\r\n        public void process(Exchange msg) {\r\n            LOG.info(\"Second process {}\", msg);\r\n        }\r\n    }\r\n}<\/pre>\n<p>Now you see my <code>Route<\/code> is very slim and without noise clutter; and I have refactored my processing code into individual classes. This promotes better code management and testing as you write more complex <code>Route<\/code> to address business logic. It let you build LEGO like block of re-usable POJO beans. Besides just processing beans, Camel use this registry space for many other services as well. For example you may customize many other component endpoints with additional features and or configurations. Or thing such as thread pool strategy implementation replacement etc.<\/p>\n<p>The <code>Route<\/code> in example above is constructed using what\u2019s called Java DSL. The route is very readable, and yet you\u2019ll get full IDE support to browse all the methods available to use for your route.<\/p>\n<p>I hope this article has helped you jump start your Camel ride. Besides the <code>timer<\/code> component mentioned, the <code>camel-core<\/code> also comes with the following components out of it\u2019s core jar.<\/p>\n<ul>\n<li><a href=\"http:\/\/camel.apache.org\/bean.html\">bean component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/browse.html\">browse component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/dataset.html\">dataset component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/direct.html\">direct component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/file.html\">file component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/log.html\">log component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/mock.html\">mock component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/properties.html\">properties component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/seda.html\">seda component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/test.html\">test component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/timer.html\">timer component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/stub.html\">stub component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/validation.html\">validator component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/vm.html\">vm component<\/a><\/li>\n<li><a href=\"http:\/\/camel.apache.org\/xslt.html\">xslt component<\/a><\/li>\n<\/ul>\n<p>Have fun!<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/saltnlight5.blogspot.com\/2013\/08\/getting-started-with-apache-camel-using.html\">Getting started with Apache Camel using Java<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Zemian Deng at the <a href=\"http:\/\/saltnlight5.blogspot.com\/\">A Programmer&#8217;s Journal<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many different protocols such as between VM, HTTP, FTP, JMS, or even DIRECTORY\/FILE, and yet still keep your processing code free of transport logic. This allows you to concentrate on digesting &hellip;<\/p>\n","protected":false},"author":267,"featured_media":52,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[357],"class_list":["post-16737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-camel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting started with Apache Camel using Java<\/title>\n<meta name=\"description\" content=\"Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with Apache Camel using Java\" \/>\n<meta property=\"og:description\" content=\"Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-08-28T13:00:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Zemian Deng\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Zemian Deng\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html\"},\"author\":{\"name\":\"Zemian Deng\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/decbcaa8856a153c212bedba0079233a\"},\"headline\":\"Getting started with Apache Camel using Java\",\"datePublished\":\"2013-08-28T13:00:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html\"},\"wordCount\":843,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-camel-logo.jpg\",\"keywords\":[\"Apache Camel\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html\",\"name\":\"Getting started with Apache Camel using Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-camel-logo.jpg\",\"datePublished\":\"2013-08-28T13:00:54+00:00\",\"description\":\"Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-camel-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-camel-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/08\\\/getting-started-with-apache-camel-using-java.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Getting started with Apache Camel using Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/decbcaa8856a153c212bedba0079233a\",\"name\":\"Zemian Deng\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a52e12ea83eca65c46f00caeddaf307d5d531c3d28ad5219d7bd7e27c45e373f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a52e12ea83eca65c46f00caeddaf307d5d531c3d28ad5219d7bd7e27c45e373f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a52e12ea83eca65c46f00caeddaf307d5d531c3d28ad5219d7bd7e27c45e373f?s=96&d=mm&r=g\",\"caption\":\"Zemian Deng\"},\"sameAs\":[\"http:\\\/\\\/saltnlight5.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Zemian-Deng\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting started with Apache Camel using Java","description":"Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html","og_locale":"en_US","og_type":"article","og_title":"Getting started with Apache Camel using Java","og_description":"Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many","og_url":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-08-28T13:00:54+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","type":"image\/jpeg"}],"author":"Zemian Deng","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Zemian Deng","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html"},"author":{"name":"Zemian Deng","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/decbcaa8856a153c212bedba0079233a"},"headline":"Getting started with Apache Camel using Java","datePublished":"2013-08-28T13:00:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html"},"wordCount":843,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","keywords":["Apache Camel"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html","url":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html","name":"Getting started with Apache Camel using Java","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","datePublished":"2013-08-28T13:00:54+00:00","description":"Apache Camel is a very useful library that helps you process events or messages from many different sources. You may move these messages through many","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/08\/getting-started-with-apache-camel-using-java.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Getting started with Apache Camel using Java"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/decbcaa8856a153c212bedba0079233a","name":"Zemian Deng","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a52e12ea83eca65c46f00caeddaf307d5d531c3d28ad5219d7bd7e27c45e373f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a52e12ea83eca65c46f00caeddaf307d5d531c3d28ad5219d7bd7e27c45e373f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a52e12ea83eca65c46f00caeddaf307d5d531c3d28ad5219d7bd7e27c45e373f?s=96&d=mm&r=g","caption":"Zemian Deng"},"sameAs":["http:\/\/saltnlight5.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Zemian-Deng"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/16737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/267"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=16737"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/16737\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/52"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=16737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=16737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=16737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}