Trying to get Apache Camel and Spring Java Config working together was not as easy as I thought it would be
considering there are examples here
and documentation here. I could not get the example
to work the way I expected it to and it all felt a bit too auto-magical to me with no explicit link between camel
and spring configuration.
So this is how I did it:
1. Add the dependencies:
2. Create the Java configuration class and set it on the Main
NOTE: The Main class used is org.apache.camel.spring.javaconfig.Main (not the basic camel one) and also the
PropertiesComponent is not required but allows you to externalise your properties values to a file.
Testing
Again, there were many existing examples, but none that played well with
me.
However, this (very contrived) example shows what I ended up using to get the test working using the Java config: