Hi Tim,
Most camel component can run without spring support, unless some
components which have some complex configuration which need Spring to do
the DI work. You can also use Guice[1] to do that part of work.
If you are not a big fan of Spring you can take a look the example that
Camel In Action Chapter one[2] shows.
public static void main(String... args) throws Exception {
CamelContext context = new DefaultCamelContext(); (1)
context.addRoutes(new RouteBuilder() { (2)
public void configure() throws Exception {
from("file://data/inbox").to("file://data/outbox"); (3)
}
context.start(); (4)
...
context.stop(); (6)
}
}
You just need to create a camel context, and add your RouteBuilder (JAVA
DSL), then start the camel context.
[1] http://camel.apache.org/guice.html
[2] http://www.manning.com/ibsen/
Willem
mumbly wrote:
I did a search on the forum, but did not see anything addressing this issue
(though it is a bit of an awkward search to make, so I may have missed
something).
I'm new to Camel (evaluating it, Spring Integration and Mule for a project)
and have been spending a little time trying to get a few different scenarios
working. My project doesn't currently use Spring and I'd prefer to avoid
additional dependencies if they aren't necessary. That said, I feel like I'm
walking upstream trying to use Camel without Spring. It seems like most of
the examples use Spring, even those that do routing using the Java DSL. I
found it rather ironic that one of the first Spring Integration examples I
ran across did not use the Spring framework, yet all of the Camel examples
(other than the simple getting started) do.
I'm not anti-Spring (I was typing in the code from the Wrox book before
there was a download for the Interface21 code) and I don't want to cut off
my nose to spite my face. If Spring + Camel gives me the preferred method of
using Camel and it is more functional to use the combination, I'm fine with
that. Just want feedback from the users/developers on whether it is worth
trying to keep Spring out.
Thanks.
--Tim