I was thinking on this post for some longer time, wondering if it’s Camel’s fault or if it’s my fault. After 8 months of working with Apache Camel my judgement is clear:
Apache Camel sucks!
DISCLAIMER: my opinions here are result of working with Apache Camel (versions 2.17 – 2.21) in context of integration with SFTP.
Apache Camel is designed such a way that every article/post comparing this framework to other integration frameworks (like Spring Integration) makes you think Apache Camel is simpler/easier (better?). Unfortunately this is only the first impression. It looks like a brilliant tool (with plenty of integration channels) however in reality it’s hard to configure and the documentation is not clear enough.
After 8 months of maintaining and extending a project using Apache Camel mainly for exchange of files through SFTP I think that Apache Camel is a significant source of problems.
- Two teams (from 2 countries) were working on configuring so called “routes” in Apache Camel and still these “routes” don’t fully work as expected.
- There were cases when Apache Camel was not logging processing errors (yes – logging or error handling was not configured as part of “route” definition) – still I think logging of unhandled exceptions is a must-have for such a framework.
- There were cases when a file was not created on SFTP server without any error or warning information provided by Apache Camel.
- It’s a real pain to configure Apache Camel to consume larger files exposed on SFTP server. I wanted the file to be deleted after consumption. However it looks that SFTP connection was lost during processing time (around 15 minutes). So the file stayed on SFTP server and Apache Camel started to consume it again (and again – endless). So I added “idempotent” option to avoid consuming files that were already processed. And it turned out it just doesn’t work as documented (and Apache Camel was still consuming the file again and again).
- Testing of Apache Camel “routes” is really hard (at least in context of SFTP integration).
- The last error (it convinced me finally to this blog post) I’ve observed was Apache Camel’s failure to generate a correct file on SFTP server. The file was consisting of multiple lines and collecting was done by Apache Camel’s (single lines were send to the Apache Camel bus). It turned out that Apache Camel overwritten parts of some randomly selected lines with other lines broking the output file format. What a shame! Restart of the application was needed to make it working again.
As a result the team lost a lot of time reading Apache Camel documentation and trying different configurations. Right now I strongly consider migrating to Spring Integration and removing Apache Camel wherever possible.
Stay out of Apache Camel as long as possible. If Apache Camel is present in your project because of some (like “political”) decision try to minimize the amount of responsibility in Apache Camel “routes”.
Avoid integration through SFTP (and FTP) at all costs. It’s an awful ancient protocol that should die and be abandoned forever. Every case of integration through SFTP can be replaced by using HTTP (HTTPS).
Some other problems with Apache Camel are nicely presented in this blog post: Alpakka (Akka Streams) vs Apache Camel: who wins?