camel again, csv bindy and file2 EIP

camel as a good EIP, best as far as i know, while i really only know few.

I am working on csv bindy recently for a project, to consume FTP csv file, and parse/marshal to java object then publish to MQ. camel is making EIP very very easy.

Just one point to put, which not so easy to locate through tons of internet information we googled:
crlf (the carriage return) is default to windows, and I think we need to change it to Unix for unix environment application.( Even though I guess it might work in either environment configuration. )

To make things slightly complex, if we wanna use camel default EIP functions, move, preMove and errorMove to handle archiving, inProgress and error handling, then be careful of the file name if you are going to change it.

For example, if we plan to change the file name, by appending the timestamp, make sure we don’t change the file extension. instead of

moveFailed=/error/${file:name}.${date:now:yyyyMMddHHmmssSSS} 

better use,

moveFailed=/error/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}

.
thats what exactly happen for me, which camel always throw “No records found in CSV file” exception, as I have put

skipFirstLine= true

, and seems camel then confused because of file extension, and can’t recognize the crlf (carriage return).

http://camel.apache.org/file2.html

http://camel.apache.org/bindy.html

Advertisements

Author: lwpro2

Java J2EE professional

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s