{"id":17407,"date":"2013-09-20T10:00:53","date_gmt":"2013-09-20T07:00:53","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=17407"},"modified":"2013-09-20T09:02:41","modified_gmt":"2013-09-20T06:02:41","slug":"exploring-apache-camel-core-file-component","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html","title":{"rendered":"Exploring Apache Camel Core &#8211; File Component"},"content":{"rendered":"<p>A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in <code>file<\/code> component is extremely flexible, and there are many options available for configuration. Let\u2019s cover few common usages here.<\/p>\n<h2>Polling a directory for input files<\/h2>\n<p>Here is a typical Camel <code>Route<\/code> used to poll a directory for input files on every second.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<pre class=\" brush:java\">import org.slf4j.*;\r\nimport org.apache.camel.*;\r\nimport org.apache.camel.builder.*;\r\nimport java.io.*;\r\n\r\npublic class FileRouteBuilder extends RouteBuilder {\r\n    static Logger LOG = LoggerFactory.getLogger(FileRouteBuilder.class);\r\n    public void configure() {\r\n        from(\"file:\/\/target\/input?delay=1000\")\r\n        .process(new Processor() {\r\n            public void process(Exchange msg) {\r\n                File file = msg.getIn().getBody(File.class);\r\n                LOG.info(\"Processing file: \" + file);\r\n            }\r\n        });\r\n    }\r\n}<\/pre>\n<p>Run this with following<\/p>\n<pre class=\" brush:java\">mvn compile exec:java -Dexec.mainClass=org.apache.camel.main.Main -Dexec.args='-r camelcoredemo.FileRouteBuilder'<\/pre>\n<p>The program will begin to poll your <code>target\/input<\/code> folder under your current directory, and wait for incoming files. To test with input files, you would need to open another terminal, and then create some files as follow.<\/p>\n<pre class=\" brush:java\">echo 'Hello 1' &gt; target\/input\/test1.txt\r\necho 'Hello 2' &gt; target\/input\/test2.txt<\/pre>\n<p>You should now see the first prompt window start to picking up the files and pass to the next <code>Processor<\/code> step. In the <code>Processor<\/code>, we obtain the <code>File<\/code> object from the message body. It then simply logs it\u2019s file name. You may hit <code>CTRL+C<\/code> when you are done.<\/p>\n<p>There many configurable options from <code>file<\/code> componet you may use in the URL, but most of the default settings are enough to get you going as simple case above. Some of these default behavior is such that if the input folder doesn\u2019t exists, it will create it. And when the file is done processing by the <code>Route<\/code>, it will be moved into a <code>.camel<\/code> folder. If you don\u2019t want the file at all after processing, then set <code>delete=true<\/code> in the URL.<\/p>\n<h2>Read in the file content and converting to different types<\/h2>\n<p>By default, the <code>file<\/code> component will create a <code>org.apache.camel.component.file.GenericFile<\/code> object for each file found and pass it down your <code>Route<\/code> as message body. You may retrieve all your file information through this object. Or alternatively, you may also use the <code>Exchange<\/code> API to auto convert the message body object to a type you expect to receive (eg: as with <code>msg.getIn().getBody(File.class)<\/code>). In above example, the <code>File<\/code> is a type you expect to get from the message body, and Camel hence will try to convert it for you. The Camel uses the context\u2019s registry space to pre-registered many <code>TypeConverter<\/code>&#8216;s that can handle most of the common data types (like Java primative etc) conversion. These <code>TypeConverter<\/code><em>s<\/em> are powerful way to make your <code>Route<\/code> and <code>Processor<\/code> more flexbile and portable.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Camel will not only convert just your <code>File<\/code> object from message body, but it can also read the file content. If your files are character text based, then you can simply do this.<\/p>\n<pre class=\" brush:java\">from(\"file:\/\/target\/input?charset=UTF-8\")\r\n        .process(new Processor() {\r\n            public void process(Exchange msg) {\r\n                String text = msg.getIn().getBody(String.class);\r\n                LOG.info(\"Processing text: \" + text);\r\n            }\r\n        });<\/pre>\n<p>That\u2019s it! Simply specify <code>String<\/code> type, and Camel will read your file in and pass the entire file text content as body message. You may even use the <code>charset<\/code> to change the encoding.<\/p>\n<p>If you are dealing with binary file, then simply try <code>byte[] bytes = msg.getIn().getBody(byte[].class);<\/code> conversion instead. Pretty cool huh?<\/p>\n<h2>Polling and processing large files<\/h2>\n<p>When working with large files, there few options in <code>file<\/code> componet that you might want to use to ensure proper handling. For example, you might want to move the input file into a <code>staging<\/code> folder before the <code>Route<\/code> starts the processing; and when it\u2019s done, move it to a <code>.completed<\/code> folder.<\/p>\n<pre class=\" brush:java\">from(\"file:\/\/target\/input?preMove=staging&amp;move=.completed\")\r\n        .process(new Processor() {\r\n            public void process(Exchange msg) {\r\n                File file = msg.getIn().getBody(File.class);\r\n                LOG.info(\"Processing file: \" + file);\r\n            }\r\n        });<\/pre>\n<p>To feed input files properly into the polling folder, it\u2019s best if the sender generates the input files in a temporary folder first, and only when it\u2019s ready then move it into the polling folder. This will minimize reading an incomplete file by the <code>Route<\/code> if the input file might take times to generate. Also another solution to this is to config <code>file<\/code> endpoint to only read the polling folder when there is a signal or ready marker file exists. For example:<\/p>\n<pre class=\" brush:java\">from(\"file:\/\/target\/input?preMove=staging&amp;move=.completed&amp;doneFileName=ReadyFile.txt\")\r\n        .process(new Processor() {\r\n            public void process(Exchange msg) {\r\n                File file = msg.getIn().getBody(File.class);\r\n                LOG.info(\"Processing file: \" + file);\r\n            }\r\n        });<\/pre>\n<p>Above will only read the <code>target\/input<\/code> folder when there is a <code>ReadyFile.txt<\/code> file exists. The marker file can be just an empty file, and it will be removed by Camel after polling. This solution would allow the sender to generate input files in however long time it might take.<\/p>\n<p>Another concern with large file processing is to avoid loading entire file content into memory for processing. To be more practical, you want to split the file into records (eg: per line) and process it one by one (or called &#8220;streaming&#8221;). Here is how you would do that using Camel.<\/p>\n<pre class=\" brush:java\">from(\"file:\/\/target\/input?preMove=staging&amp;move=.completed\")\r\n        .split(body().tokenize(\"\\n\"))\r\n        .streaming()\r\n        .process(new Processor() {\r\n            public void process(Exchange msg) {\r\n                String line = msg.getIn().getBody(String.class);\r\n                LOG.info(\"Processing line: \" + line);\r\n            }\r\n        });<\/pre>\n<p>This <code>Route<\/code> will allow you to process large size file without cosuming too much memory and process it line by line very efficiently.<\/p>\n<h2>Writing messages back into file<\/h2>\n<p>The <code>file<\/code> component can also be used to write messages into files. Recall that we may use <code>dataset<\/code> component to generate sample messages. We will use that to feed the <code>Route<\/code> and send to the <code>file<\/code> component so you can see that each message generated will be saved into a file.<\/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\nimport org.apache.camel.component.dataset.*;\r\n\r\npublic class FileDemoCamel extends Main {\r\n    static Logger LOG = LoggerFactory.getLogger(FileDemoCamel.class);\r\n    public static void main(String[] args) throws Exception {\r\n        FileDemoCamel main = new FileDemoCamel();\r\n        main.enableHangupSupport();\r\n        main.addRouteBuilder(createRouteBuilder());\r\n        main.bind(\"sampleGenerator\", createDataSet());\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(\"dataset:\/\/sampleGenerator\")\r\n                .to(\"file:\/\/target\/output\");\r\n            }\r\n        };\r\n    }\r\n    static DataSet createDataSet() {\r\n        return new SimpleDataSet();\r\n    }\r\n}<\/pre>\n<p>Compile and run it<\/p>\n<pre class=\" brush:java\">mvn compile exec:java -Dexec.mainClass=camelcoredemo.FileDemoCamel<\/pre>\n<p>Upon complete you will see that 10 files would be generated in <code>target\/output<\/code> folder with file name in <code>ID-&lt;hostname&gt;-&lt;unique-number&gt;-&lt;msg-seq-num&gt;<\/code> format.<\/p>\n<p>There are more options availabe from <a href=\"http:\/\/camel.apache.org\/file2.html\">File<\/a> component that you may explore. <a href=\"http:\/\/saltnlight5.blogspot.com\/2013\/08\/getting-started-with-apache-camel-using.html\">Try it out with a Route<\/a> and see it for yourself.<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\/09\/exploring-apache-camel-core-file.html\">Exploring Apache Camel Core &#8211; File Component<\/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>A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options available for configuration. Let\u2019s cover few common usages here. Polling a directory for input files Here is a typical Camel Route used to poll a directory for input files on &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-17407","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>Exploring Apache Camel Core - File Component<\/title>\n<meta name=\"description\" content=\"A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options\" \/>\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\/09\/exploring-apache-camel-core-file-component.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exploring Apache Camel Core - File Component\" \/>\n<meta property=\"og:description\" content=\"A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.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-09-20T07:00:53+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=\"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\\\/09\\\/exploring-apache-camel-core-file-component.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html\"},\"author\":{\"name\":\"Zemian Deng\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/decbcaa8856a153c212bedba0079233a\"},\"headline\":\"Exploring Apache Camel Core &#8211; File Component\",\"datePublished\":\"2013-09-20T07:00:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html\"},\"wordCount\":812,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.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\\\/09\\\/exploring-apache-camel-core-file-component.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html\",\"name\":\"Exploring Apache Camel Core - File Component\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-camel-logo.jpg\",\"datePublished\":\"2013-09-20T07:00:53+00:00\",\"description\":\"A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/exploring-apache-camel-core-file-component.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\\\/09\\\/exploring-apache-camel-core-file-component.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\":\"Exploring Apache Camel Core &#8211; File Component\"}]},{\"@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":"Exploring Apache Camel Core - File Component","description":"A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options","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\/09\/exploring-apache-camel-core-file-component.html","og_locale":"en_US","og_type":"article","og_title":"Exploring Apache Camel Core - File Component","og_description":"A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options","og_url":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-09-20T07:00:53+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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html"},"author":{"name":"Zemian Deng","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/decbcaa8856a153c212bedba0079233a"},"headline":"Exploring Apache Camel Core &#8211; File Component","datePublished":"2013-09-20T07:00:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html"},"wordCount":812,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.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\/09\/exploring-apache-camel-core-file-component.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html","url":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html","name":"Exploring Apache Camel Core - File Component","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-camel-logo.jpg","datePublished":"2013-09-20T07:00:53+00:00","description":"A file poller is a very useful mechanism to solve common IT problems. Camel\u2019s built-in file component is extremely flexible, and there are many options","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/exploring-apache-camel-core-file-component.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\/09\/exploring-apache-camel-core-file-component.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":"Exploring Apache Camel Core &#8211; File Component"}]},{"@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\/17407","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=17407"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/17407\/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=17407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=17407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=17407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}