On Mon, Jul 19, 2010 at 10:57 PM, Jim Newsham <jnews...@referentia.com> wrote: > On 7/19/2010 8:13 AM, Claus Ibsen wrote: >> >> Hi >> >> >> On Mon, Jul 19, 2010 at 8:06 PM, Ron Smith<ronsmit...@gmail.com> wrote: >>> >>> Where I work, Spring has been declared "evil" so I am attempting to use >>> camel without any of the Spring JARs but I can't find any examples of how >>> to >>> setup a JMS component without a Spring dependency. I am using Tibco as >>> the >>> JMS provider and it is providing JNDI. >>> >> It must be a touch workplace when a general considered standard >> framework is considered evil? >> >> The camel-jms component leverages spring-jms for sending and receiving >> JMS messages and therefore >> you cannot use it without spring-jms. >> >> You can use plain JMS API if you want to avoid Spring and build a JMS >> consumer. >> For examples see the ActiveMQ in Action which shows that. And I am >> sure you may find other examples by googling as well. >> >> To send the message to Camel is very easy from Java code. For example >> just use the ProducerTemplate API. > > We're also looking into using Camel + JMS (ActiveMQ in particular). We > don't use spring and have no intention to do so currently (no discussion > about whether it's evil or not; it just doesn't suit our purposes at the > moment). > > I was disappointed to discover that I needed to add the following jars in > addition to camel-core, camel-jms, and activemq-all before it would run: > activemq-pool, commons-logging, commons-management, commons-pool, > spring-aop, spring-beans, spring-context, spring-core, spring-jms, > spring-tx. Particularly for a project which claims to have minimal > dependencies, this seems a little excessive. I'm not griping -- if we > choose to use Camel (which seems likely) then we'll happily (yet > reluctantly) add these extra jars. It just would be nice if such an > internal dependency did not exist, for developers who do not use spring. >
If you are NOT using AMQ then you dont need any AMQ jars at all. The camel-core has a minimal dependency set. - commons-logging - commons-management If you want to use JMX with Camel then we leverage spring-jmx annotations. And therefore you need to drop in a couple of Spring jars to use JMX. The native JMX API in the JDK is a terrible API that is painful to use. Spring JMX makes it easy to annotation your beans and that's it. In fact SUN should have created a standard set of JMX annotations, which is a perfect fit for a good use-case for annotations. Unfortunately they never did. If they do we would sure leverage it instead of using the Spring @ManagedResource annotations. And on JDK 1.5 you need a little extra for XML parsers and Attachments support. But those are as said provided out of the box in JDK 1.6 onwards. Of course the many Camel components requires the set of jars that those 3rd party libraries are using. For example camel-ftp requires what the Apache Commons Net project need etc. For camel-jms as its leveraging spring-jms, requires what spring-jms needs. And it need about 6-10 jars. Camel does not suffer from NIH syndrome and it would be madness to go out and implement our own JMS component from scratch. Spring has been battle tested, its mature and been around for a long time, and it has a professional company behind with very talented people who maintain a high quality framework. camel-jms can be used without end users seeing Spring at all. You do not need to use Spring XML files and its bean container etc. Just think of the spring jars as the API for the JMS stuff. > Regards, > Jim > > > > > > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus