{"id":7421,"date":"2013-01-23T13:00:12","date_gmt":"2013-01-23T11:00:12","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=7421"},"modified":"2013-01-23T06:27:51","modified_gmt":"2013-01-23T04:27:51","slug":"apache-camel-cheatsheet","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html","title":{"rendered":"Apache Camel Cheatsheet"},"content":{"rendered":"<p>&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<h2>Polling an empty directory (and send an empty message with null body) :<\/h2>\n<pre class=\" brush:java\">from('file:\/\/temp?sendEmptyMessageWhenIdle=true')<\/pre>\n<h2>Stop a route :<\/h2>\n<pre class=\" brush:java\">.process(new Processor() {\r\n public void process(Exchange exchange) throws Exception {\r\n  getContext().stopRoute('ROUTE_ID');\r\n }\r\n})<\/pre>\n<h2>Access a property of the object in the body :<\/h2>\n<p>admitting the object has a method named &#8216;getMydata()&#8217; :<\/p>\n<pre class=\" brush:java\">new ValueBuilder(simple('${body.mydata}')).isEqualTo(...)<\/pre>\n<h2>Define an aggregator :<\/h2>\n<pre class=\" brush:java\">.aggregate(simple('${header.id}.substring(0,15)'), \r\n       genericAggregationStrategy)\r\n.completionPredicate(header(Exchange.BATCH_COMPLETE)\r\n      .isEqualTo(Boolean.TRUE))<\/pre>\n<ul>\n<li><code>'${header.id}.substring(0,15)'<\/code> : flag to differenciate messages (here, the returned string is common to all messages, we aggregate them all)<\/li>\n<li><code>Exchange.BATCH_COMPLETE<\/code> : predicate indicating the end of polling (all files parsed for example)<\/li>\n<li><code>genericAggregationStrategy<\/code> : above, an example of an aggregator grouping all messages&#8217; contents in a list :<\/li>\n<\/ul>\n<pre class=\" brush:java\">public class GenericAggregationStrategy implements AggregationStrategy {\r\n  @SuppressWarnings('unchecked')\r\n  public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {\r\n    if (oldExchange == null) {\r\n      ArrayList&lt;Object&gt; list = new ArrayList&lt;Object&gt;();\r\n      list.add(newExchange.getIn().getBody());\r\n      newExchange.getIn().setBody(list);\r\n      return newExchange;\r\n    } else {\r\n      Object oldIn = oldExchange.getIn().getBody();\r\n      ArrayList&lt;Object&gt; list = null;\r\n      if(oldIn instanceof ArrayList) {\r\n        list = (ArrayList&lt;Object&gt;) oldIn;\r\n      } else {\r\n        list = new ArrayList&lt;Object&gt;();\r\n        list.add(oldIn);\r\n      }\r\n      list.add(newExchange.getIn().getBody());\r\n      newExchange.getIn().setBody(list);\r\n      return newExchange;\r\n    }\r\n  }\r\n}<\/pre>\n<h2>Manually trigger an aggregation&#8217;s completion (whatever it is) :<\/h2>\n<p>Send a message with the header <code>Exchange.AGGREGATION_COMPLETE_ALL_GROUPS = true<\/code><br \/>\nIt is possible to do <code>from('bean:...')<\/code>, knowing that the bean will be polled permanently (like with &#8216;file&#8217;) and re-instanciated each time.<strong>Modify the message&#8217;s body <\/strong>on a route, using :<\/p>\n<pre class=\" brush:java\">.transform(myExpression)<\/pre>\n<p>with <code>myExpression<\/code> :<\/p>\n<pre class=\" brush:java\">public class MyExpression implements Expression {\r\n  public &lt;T&gt; T evaluate(Exchange exchange, Class&lt;T&gt; type) {\r\n    MyBean newData = ...;\r\n    return exchange.getContext().getTypeConverter()\r\n      .convertTo(type, newData);\r\n  }\r\n}<\/pre>\n<h2>Using JaxB :<\/h2>\n<ul>\n<li>on a route :\n<pre class=\" brush:java\">.[un]marshal().jaxb('my.business_classes.package')<\/pre>\n<\/li>\n<li>with a configurable DataFormat :\n<pre class=\" brush:java\">.[un]marshal(jaxbDataFormat)<\/pre>\n<p>with :<\/li>\n<\/ul>\n<pre class=\" brush:java\">\/\/ indicate to Jaxb to not write XML prolog :\r\nJaxbDataFormat jaxbDataFormat = \r\n   new JaxbDataFormat('my.business_classes.package');\r\njaxb.setFragment(true);<\/pre>\n<h2>General concepts for threads management :<\/h2>\n<ul>\n<li>a <code>from(...)<\/code> = a thread<\/li>\n<li>except for <code>from('direct:...')<\/code> wich creates a &#8216;named route&#8217; with a unique identifier only callable by another route (in the same thread than the caller).<\/li>\n<li>The component <code>.resequence().batch()<\/code> creates a new thread to rethrow the messages.<\/li>\n<\/ul>\n<h2>Define a shutdown strategy :<\/h2>\n<pre class=\" brush:java\">getContext().setShutdownStrategy(new MyShutdownStrategy(getContext()));<\/pre>\n<p>With :<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\">public class MyShutdownStrategy extends DefaultShutdownStrategy {\r\n   protected CamelContext camelContext;\r\n   private long timeout = 1;\r\n   private TimeUnit timeUnit = TimeUnit.SECONDS;\r\n   public SpiralShutdownStrategy(CamelContext camelContext) {\r\n      this.camelContext = camelContext;\r\n   }\r\n\r\n   @Override\r\n   public long getTimeout() {\r\n      return this.timeout;\r\n   }\r\n\r\n   @Override\r\n   public TimeUnit getTimeUnit() {\r\n      return this.timeUnit;\r\n   }\r\n\r\n   @Override\r\n   public CamelContext getCamelContext() {\r\n      return this.camelContext;\r\n   }\r\n\r\n   \/**\r\n   * To ensure shutdown\r\n   *\r\n   *\/\r\n   @Override\r\n   public void suspend(CamelContext context, \r\n        List&lt;RouteStartupOrder&gt; routes) throws Exception {\r\n      doShutdown(context, routes, getTimeout(), \r\n          getTimeUnit(), false, false, false);\r\n   }\r\n\r\n   \/**\r\n   * To ensure shutdown\r\n   *\r\n   *\/\r\n   @Override\r\n   public void shutdown(CamelContext context, \r\n        List&lt;RouteStartupOrder&gt; routes, long timeout, \r\n        TimeUnit timeUnit) throws Exception {\r\n      doShutdown(context, routes, this.timeout, \r\n           this.timeUnit, false, false, false);\r\n   }\r\n\r\n   \/**\r\n   * To ensure shutdown\r\n   *\r\n   *\/\r\n   @Override\r\n   public boolean shutdown(CamelContext context, RouteStartupOrder route, \r\n      long timeout, TimeUnit timeUnit, boolean abortAfterTimeout)\r\n         throws Exception {\r\n      super.shutdown(context, route, this.timeout, \r\n          this.timeUnit, false);\r\n      return true;\r\n   }\r\n}<\/pre>\n<h2>Stop a batch :<\/h2>\n<pre class=\" brush:java\">.process(new Processor() {\r\n   public void process(Exchange exchange) throws Exception {\r\n      context.stop();\r\n   }\r\n});<\/pre>\n<h2>Calling a method of a bean from a route:<\/h2>\n<ol>\n<li>method&#8217;s return is always affected to message&#8217;s body. For example :\n<ul>\n<li><code>public void myMethod(Exchange e) <\/code>:<br \/>\nWill not modify the body<\/li>\n<li><code>public boolean myMethod(Exchange e) <\/code>:<br \/>\nthe boolean (or whatever primitive type) will be set in the body<\/li>\n<li><code>public Object myMethod(Exchange e)<\/code> :<br \/>\nthe Object will be placed in the body (even if null)<\/li>\n<li><code>public Message myMethod(Exchange e)<\/code> :<br \/>\nthe Message will be placed in the body (better avoid this)<\/li>\n<li><code>public List&lt;Object&gt; myMethod(Exchange e)<\/code> :<br \/>\nthe list will be set in the body : useful to use with <code>.split()<\/code>, each object will be sent in a new message<\/li>\n<li><code>public List&lt;Message&gt; myMethod(Exchange e)<\/code> :<br \/>\nthe list will be set in the body : a <code>.split()<\/code> will create a new message for each element (better avoid, see upper)<\/li>\n<\/ul>\n<\/li>\n<li>configurable method&#8217;s parameters :\n<ul>\n<li><code>public void myMethod(Exchange e) <\/code>:<br \/>\nthe complete Exchange will be passed<\/li>\n<li><code>public void myMethod(Object o) <\/code>:<br \/>\nCamel will try to convert the body in the required parameter&#8217;s class<\/li>\n<li><code>public void myMethod(@Body File o, @Header('myHeader') String myParamHeader) <\/code>:<br \/>\nCamel will inject each parameter as specified<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>Exceptions management on routes : <\/h2>\n<ul>\n<li>in a global way (to be declared before all routes) :\n<pre class=\" brush:java\">onException(MyException.class, RuntimeCamelException.class).to(...)...<\/pre>\n<\/li>\n<li>to truly handle Exception and not bubble it in routes (and logs) :\n<pre class=\" brush:java\">onException(...).handled(true).to(...)...<\/pre>\n<\/li>\n<li>to continue process in a route after an Exception :\n<pre class=\" brush:java\">onException(...).continued(true).to(...)...<\/pre>\n<\/li>\n<li>An exception is &#8216;handled&#8217; or &#8216;continued&#8217;<\/li>\n<li>local way (in a route) :\n<pre class=\" brush:java\">from(...)\r\n.onException(...).to('manage_error').log('FAIL !!').end()\r\n.to('continue_route')...<\/pre>\n<\/li>\n<\/ul>\n<p>For writing file, only the header <code>Exchange.FILE_NAME<\/code> is necessary.<\/p>\n<h2>Reorder messages with component <code>.resequence<\/code> :<\/h2>\n<ul>\n<li>uses an expression to compute the new order of messages, from a unique Comparable &#8216;key&#8217; (number, String or custom Comparator)<\/li>\n<li>two ways :\n<ul>\n<li>.batch() : batch mode. Waits the reception of ALL the messages befor reorder them. <strong>ATTENTION <\/strong>: a new thread is created to rethrow messages.<\/li>\n<li>.stream() : streaming mode. Uses a gap detection between the messages&#8217; keys to re-send them. It is possible to configure a maximal capacity and a timeout.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Split the body with a token :<\/h2>\n<pre class=\" brush:java\">.split(body().tokenize('TOKEN'))<\/pre>\n<p>Knowing that the TOKEN will be deleted from content. For example, if receiving a message containing : &#8216;data1TOKENdata2TOKENdata3&#8217;, messages created will be : &#8216;data1&#8217;, &#8216;data2, &#8216;data3&#8217;. So avoid this when treating XML data, prefer &#8216;tokenizeXML()&#8217;.<\/p>\n<h2>Dynamic access to body&#8217;s data :<\/h2>\n<ul>\n<li>Lightweight &#8216;script&#8217; language : <a href=\"http:\/\/camel.apache.org\/simple.html\" target=\"_blank\">Simple Expression Language<\/a><\/li>\n<li>Read files data : <a href=\"http:\/\/camel.apache.org\/file-language.html\" target=\"_blank\">File Expression Language<\/a><\/li>\n<\/ul>\n<h2>Sending mails :<\/h2>\n<pre class=\" brush:java\">from('direct:mail')\r\n .setHeader('To', constant(mailTo))\r\n .setHeader('From', constant(mailFrom)) \r\n .setHeader('Subject', constant(mailSubject)) \r\n .to('smtp:\/\/${user}@${server}:${port}?password=${password}');<\/pre>\n<h2>With attachment :<\/h2>\n<pre class=\" brush:java\">.beanRef(MAIL_ATTACHER, 'attachLog');\r\n\/\/with\r\npublic class MailAttacher {\r\n   public void attachLog(Exchange exc) throws Exception {\r\n      File toAttach = ...;   \r\n      exc.getIn().addAttachment(toAttach.getName(), \r\n               new DataHandler(new FileDataSource(toAttach)));\r\n      \/\/ if needed\r\n      exc.setProperty(Exchange.CHARSET_NAME, 'UTF-8');\r\n   }\r\n}<\/pre>\n<h2>Useful Exchange&#8217;s properties :<\/h2>\n<ul>\n<li>Exchange.AGGREGATED_* : aggregations management<\/li>\n<li>Exchange.BATCH_* : treated messages management<\/li>\n<li>Exchange.FILE_* : File messages management<\/li>\n<li>Exchange.HTTP_* : web requests management<\/li>\n<li>Exchange.LOOP_* : loops management<\/li>\n<li>Exchange.REDELIVERY_* : exceptions management<\/li>\n<li>Exchange.SPLIT_* : splitted contents management<\/li>\n<\/ul>\n<h2>Loop a route :<\/h2>\n<pre class=\" brush:java\">from('direct:...')\r\n.loop(countExpression)\r\n.to('direct:insideLoop')\r\n.end()<\/pre>\n<p>Where &#8216;countExpression&#8217; is an Expression used to dynamically compute the loop count (evaluated entering the loop). It is preferable to move the loop&#8217;s code in a new route if the process is complex.<\/p>\n<h2>Headers management :<\/h2>\n<p>Message&#8217;s headers are defined at its creation. When using a &#8216;.split()&#8217;, all subsequent messages will have the same headers from the original message (so be careful when managing files). In an aggregation, custom headers will have to be managed manually to be preserved in the rest of the route.<\/p>\n<h2>Intercept a message<\/h2>\n<p> and execute a route parallely (to be declared before routes) :<\/p>\n<pre class=\" brush:java\">interceptSendToEndpoint('ENDPOINT_TO_INTERSEPT').to(...)...<\/pre>\n<p>&nbsp;<\/p>\n<p><strong><em>Reference: <\/em><\/strong><a href=\"http:\/\/developpef.blogspot.com\/2013\/01\/camel-cheatsheet.html\">Apache Camel Cheatsheet<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Paul-Emmanuel at the <a href=\"http:\/\/developpef.blogspot.com\/\">Developpef<\/a> blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) : from(&#8216;file:\/\/temp?sendEmptyMessageWhenIdle=true&#8217;) Stop a route : .process(new Processor() { public void process(Exchange exchange) throws Exception { getContext().stopRoute(&#8216;ROUTE_ID&#8217;); } }) Access a property of the object in the body : admitting the object &hellip;<\/p>\n","protected":false},"author":95,"featured_media":52,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[357],"class_list":["post-7421","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>Apache Camel Cheatsheet<\/title>\n<meta name=\"description\" content=\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) :\" \/>\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\/01\/apache-camel-cheatsheet.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Camel Cheatsheet\" \/>\n<meta property=\"og:description\" content=\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) :\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.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-01-23T11:00:12+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=\"Paul Emmanuel Faidherbe\" \/>\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=\"Paul Emmanuel Faidherbe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html\"},\"author\":{\"name\":\"Paul Emmanuel Faidherbe\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/3286e793ae6534bc7f94fc8a36fd5977\"},\"headline\":\"Apache Camel Cheatsheet\",\"datePublished\":\"2013-01-23T11:00:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html\"},\"wordCount\":668,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.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\\\/01\\\/apache-camel-cheatsheet.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html\",\"name\":\"Apache Camel Cheatsheet\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-camel-logo.jpg\",\"datePublished\":\"2013-01-23T11:00:12+00:00\",\"description\":\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) :\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/apache-camel-cheatsheet.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\\\/01\\\/apache-camel-cheatsheet.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\":\"Apache Camel Cheatsheet\"}]},{\"@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\\\/3286e793ae6534bc7f94fc8a36fd5977\",\"name\":\"Paul Emmanuel Faidherbe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ad9fb5e799e172d3c5cd905a609713eb94d9e494902f898d6995ce7edc39d57?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ad9fb5e799e172d3c5cd905a609713eb94d9e494902f898d6995ce7edc39d57?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ad9fb5e799e172d3c5cd905a609713eb94d9e494902f898d6995ce7edc39d57?s=96&d=mm&r=g\",\"caption\":\"Paul Emmanuel Faidherbe\"},\"sameAs\":[\"http:\\\/\\\/developpef.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Paul-Emmanuel-Faidherbe\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Camel Cheatsheet","description":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) :","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\/01\/apache-camel-cheatsheet.html","og_locale":"en_US","og_type":"article","og_title":"Apache Camel Cheatsheet","og_description":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) :","og_url":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-01-23T11:00:12+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":"Paul Emmanuel Faidherbe","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Paul Emmanuel Faidherbe","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html"},"author":{"name":"Paul Emmanuel Faidherbe","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/3286e793ae6534bc7f94fc8a36fd5977"},"headline":"Apache Camel Cheatsheet","datePublished":"2013-01-23T11:00:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html"},"wordCount":668,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.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\/01\/apache-camel-cheatsheet.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html","url":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html","name":"Apache Camel Cheatsheet","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","datePublished":"2013-01-23T11:00:12+00:00","description":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Polling an empty directory (and send an empty message with null body) :","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/apache-camel-cheatsheet.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\/01\/apache-camel-cheatsheet.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":"Apache Camel Cheatsheet"}]},{"@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\/3286e793ae6534bc7f94fc8a36fd5977","name":"Paul Emmanuel Faidherbe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9ad9fb5e799e172d3c5cd905a609713eb94d9e494902f898d6995ce7edc39d57?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9ad9fb5e799e172d3c5cd905a609713eb94d9e494902f898d6995ce7edc39d57?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9ad9fb5e799e172d3c5cd905a609713eb94d9e494902f898d6995ce7edc39d57?s=96&d=mm&r=g","caption":"Paul Emmanuel Faidherbe"},"sameAs":["http:\/\/developpef.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Paul-Emmanuel-Faidherbe"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7421","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\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=7421"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7421\/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=7421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=7421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=7421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}