Re: Advice Needed on Design (From ActiveMQ List)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Advice Needed on Design (From ActiveMQ List)

Adam Sherman
(I figure I should switch lists.)

On Oct 12, 2007, at 13:09, Adam Sherman wrote:
> On Oct 12, 2007, at 10:31, James Strachan wrote:
>> To get things going and to avoid you having to worry about how to use
>> the JMS API properly and so forth I'd recommend you experiment with
>> the Bean Integration in Camel...
>
> I'm not clear on what Camel actually is though. Going to go watch  
> your screencast now.

Ok, I'm trying to wrap my head around it.

I currently configure ActiveMQ as follows:

     <!-- JMS Broker -->
     <amq:broker id="broker1" useJmx="false" persistent="false">
         <amq:transportConnectors>
             <amq:transportConnector uri="tcp://localhost:61616?
trace=true" />
         </amq:transportConnectors>
     </amq:broker>

     <!-- JMS ConnectionFactory to use, configuring the embedded  
broker using XML -->
     <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost?
create=false" />

     <amq:queue id="destination"  
physicalName="com.dotsub.tcms.destination"/>

Where "destination" is my first test destination.

Then I use Spring's MessageListenerAdapter to get messages into my POJO:

        <bean id="convertMessageListener"  
class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
            <constructor-arg>
                <bean  
class="com.dotsub.tcms.processor.ConvertMessageListenerImpl">
                    <property name="videoConverter"  
ref="videoConverter" />
                </bean>
            </constructor-arg>
        </bean>

        <bean id="convertMessageListenerContainer"
           
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
  depends-on="jmsFactory">
          <property name="concurrentConsumers" value="1"/>
          <property name="connectionFactory" ref="jmsFactory" />
          <property name="destination" ref="destination" />
          <property name="messageListener"  
ref="convertMessageListener" />
        </bean>

For sending messages to the videoConverter I just use Spring's  
JmsTemplate.convertAndSend() method.

Can you please quickly sketch out what I would do to use Camel here?

Thank you very much for your assistance.

A.

--
Adam Sherman
Technologist
+1 (613) 797-6819 | http://www.sherman.ca/ | sip:[hidden email]