You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ryan Gardner <ry...@gmail.com> on 2009/06/17 00:36:29 UTC
Getting camel's activemq: endpoints to work with Spring's flex-spring integration
Spring-Flex has a simplified way to get blazeds to find jms topics for
things using Spring's JMS templates. Since (as far as I know) camel
uses spring's jms templates, this should work well with camel.
http://static.springframework.org/spring-flex/docs/1.0.x/reference/html/ch05s04.html
is where it is documented. They say:
-----------
For integration with JMS, a special JmsAdapter is provided that
internally makes use of Spring's JmsTemplate,
DestinationResolver,DefaultMessageListenerContainer and other such JMS
abstractions for simplified interaction with JMS resources. The jms-
message-destination XML namespace tag is used to expose JMS
destinations as BlazeDS message destinations. The minimal attributes
that must be specified are the destination id and exactly one of jms-
destination, queue-name, or topic-name. A JMS ConnectionFactory
reference is also required, but does not have to be explicitly
specified if there is already one configured in the current
application context with an id of "connectionFactory". For example, to
configure a BlazeDS message destination named "chatIn" that uses a
Spring-managed ActiveMQ JMS queue with a local ActiveMQ installation:
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<bean id="chatInQueue"
class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.flex.chat.in"/>
</bean>
<flex:jms-message-destination id="chatIn" jms-
destination="chatInQueue" />
Using queue-name or topic-name will cause the destination to be
resolved using a Spring DestinationResolver. The destination-resolver,
message-converter, and transaction-manager attributes may be used to
set custom references to a Spring-managed DestinationResolver,
MessageConverter, or TransactionManager respectively.
------------
It would seem that I should be able to do something like this:
...
<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
...
<flex:jms-message-destination id="someDestinationID" jms-
destination="fooTopic" connectionFactory="jmsFactory" />
And then this should use springs default destination resolvers to find
something being posted to my activemq:fooTopic endpoint?
I'm going to try it this way and see how it works, but figured I'd
post this question to see if I have some horribly wrong understanding
of how this should work.
Ryan