I built a camel route that unmarshals a csv file using camel bindy and writes the contents to a database. This works perfectly apart from when the file is empty, which by the looks of it will happen a lot. The file does contain csv headers, but no relevant data e.g.:
CODE;CATEGORY;PRICE;
In this case the following error is thrown:
java.lang.IllegalArgumentException: No records have been defined in the CSV
I tried adding allowEmptyStream = true
to the bindy object that I use for unmarshalling. This however does not seem to do much, as the same error appears.
Any ideas on how to skip processing these empty files is very welcome.