camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: How does Camel work with ActiveMQ ?
Date Wed, 27 Jan 2010 12:06:43 GMT
BenXS wrote:
> Thank you all. But I still have difficulties to understand general procedure.
> 
> Starting with a successful installed ActiveMQ I did so far:
> 1.) at first I uncomment
> 
> <import resource="camel.xml"/>
> 
> in activemq.xml. Fine. Now camel.xml in activemq installation will be used
> by ActiveMQ.
> Is this sufficient to activate basically Camel in ActiveMQ?
> 
> 2.) When I look now into the default, sample camel.xml in ActiveMQ v5.3. I
> can see
> <camelContext> and <bean> definition. As far as I understand from Camel docs
> <bean> declarations are only used when I pass JMS msgs to java prgrams.
> So I comment it out. Am I correct at this point?

No, you should not comment out that bean declaration, otherwise camel 
will not know to create "activemq" endponit.

  <!-- configure the camel activemq component to use the current broker -->
     <bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent" >
         <property name="connectionFactory">
           <bean class="org.apache.activemq.ActiveMQConnectionFactory">
             <property name="brokerURL" 
value="vm://localhost?create=false&amp;waitForStart=10000" />
             <property name="userName" value="${activemq.username}"/>
             <property name="password" value="${activemq.password}"/>
           </bean>
         </property>
     </bean>
This configuration tell the camelContext the activemq components' broker 
and other setting.

Willem


> 
> What I want is a super simple recording of all incoming JMS msgs in Queue
> "myqueue123" 
> into an XML file each. The name of the respective XML file should be equal
> to the 
> MessageID of the JMS msg.
> 
> I think according to page
> 
> http://activemq.apache.org/enterprise-integration-patterns.html
> 
> "Writing EIP rules using XML" should be used.
> 
> So what <camelContext> do I have to write?
> 
> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>   <route>
>     <from uri="activemq:com.acme.MyQueue"/>
>     <to uri="activemq:com.acme.SomeOtherQueue"/>
>   </route>
> </camelContext>
> 
> as shown on the doc page mentioned above is not appropriate. I don't want to
> forward JMS msgs to other queues. According to page
> 
> http://camel.apache.org/file2.html
> 
> I think it must be something
> 
> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>   <route>
>     <from uri="activemq:myqueue123"/>
>     <to uri="file:subfolderwherexmlfileshouldbeput"/>
>   </route>
> </camelContext>
> 
> But this does not work. No files were written.
> 
> What am I doing wrong?
> 
> Ben
> 

Mime
View raw message