I am working on a simple example where i have file in source folder which contains a list of customer id's separated by a marker. I am passing this file through the camel router logic and passing it the bean class. In the bean class I am trying to extract the customer ids and then using those customer id's i am trying to dynamically generate a file with name as "Customers_<customerid>.txt". The problem I am facing is the file name i am taking is coming from header, i.e., "Customers" is coming from exchange header as "Customers.txt". This is the file that contains all the data.
Below I have provided the code
But this code is not working as expected. Can any one please help where and what I am doing wrong.
as for the files they are contained in the "src/data" and the out put folder is src/outbox". My objective is to take the file available in src/data/Customer.txt and from the file extract all the customer id's and then dynamically create files and transfer it to src/outbox folder as "Customer_<customerid>.txt" file.