Hi Camel riders,
I'm in the process of writing a web app which needs to simply place a
message on a JMS queue. This is then picked up by an independent
project with Camel routes in it. What I am trying to do is write the
smallest Camel config I need with Spring for the web app. All I think I
really need is a Camel ProducerTemplate and a JmsComponent definition
which details the ActiveMQ connection details.
I am hoping to just use the following (I've removed namespace
definitions)
<beans>
<camel:template id="camelTemplate" />
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
</beans>
Do I need to define a <camel:camelContext> at all?
Has anything changed regarding the <camel:template /> element since
CamelTemplate was deprecated for ProducerTemplate? I've set up a
AbstractJUnit4SpringContextTests with @Autowired on a ProducerTemplate
field and asserted it exists and is an instance of
DefaultProducerTemplate. Was it ever considered to adjust the element
name to be camel:producerTemplate so it is more obvious what it is? Is
it likely there will ever be another *Template in Camel that would make
this element name confusing?
Thanks,
Martin