You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by BenXS <bx...@yahoo.co.uk> on 2010/01/25 20:10:04 UTC

How does Camel work with ActiveMQ ?

>From pages like 

http://camel.apache.org/wire-tap.html

I tried to figure out on how Camel works in ActiveMQ.

Say I have a running ActiveMQ installation and I want to save a copy of
every JSM msg wihc arrives in
the queue mytestqueue123 into a separate XML file in directory D:\testcamel

How do I setup and integrate Camel into ActiveMQ to achieve this?
Unfortunately there is no quick intro for this test scenario.

Ben
-- 
View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27311853.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How does Camel work with ActiveMQ ?

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jan 29, 2010 at 12:30 PM, BenXS <bx...@yahoo.co.uk> wrote:
>
> Ok, thank you.
>
> So duplication is not possible with Camel at all?
>

Its the JMS Broker which may or may not offer such a feature to
duplicate/log whatever comes into it.
If using AMQ then try looking and asking at AMQ user forum.
Its just not a standard feature in JMS. Hence the different vendors
may have a custom solution for that.

If you use Camel to send the messages then you can of course let Camel
log a message before its send.

And spend some time googling what you want. It took me 5 sec to google
and find this link:
http://old.nabble.com/How-to-log-all-incoming-and-outgoing-JMS-msgs--td27307961.html


> Or is this route command only the wrong way to achieve this?
>
> I need simply a way to log all incoming JMS msgs in a certain queue to
> either
> - another queue
> or alternatively
> - an own xml file
>
> The JMS msg should be (beside the logging) normally consumed by another
> process.
>
> How should I setup such a <route> config command?
>
> Ben
>
>
> Claus Ibsen-2 wrote:
>>
>> On Fri, Jan 29, 2010 at 11:32 AM, BenXS <bx...@yahoo.co.uk> wrote:
>>>
>>> Ok, so I leave the <bean> active and specified as camelContext in
>>> camel.xml
>>> in activemq config dir:
>>>
>>> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>>> <packageScan>
>>>  <packages>org.foo.bar</packages>
>>>  </packageScan>
>>>  <route>
>>>  <from uri="activemq:myqueue123" />
>>>  <to uri="activemq:myqueue555" />
>>>  </route>
>>> </camelContext>
>>>
>>> In order to duplicate all incoming JMS msgs and put their clone into
>>> another
>>> queue myqueue555 on the same MessageBroker.
>>>
>>> Unfortunately when I sent now a message into myqueue123 then after a
>>> couple
>>> of seconds the following error messages appear in ActiveMQ window and the
>>> messages were NOT duplicated as intended.
>>
>> You are not duplicating messages, you are routing them. That is the
>> way JMS works.
>> When you consume a message from a queue its being removed from that
>> queue. JMS do not do copies per see.
>>
>> And about that exception. Its because your JMS message on the Queue
>> have a JMSReplyTo set which makes Camel use request/reply over JMS.
>> You can use option disableReplyTo=true when on the <to> endpoint to
>> ignore JMSReplyTo.
>>
>>
>>>
>>> Why?
>>>
>>>  INFO | ActiveMQ WebConsole initialized.
>>>  INFO | Initializing Spring FrameworkServlet 'dispatcher'
>>>  INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
>>>  INFO | Initializing Spring root WebApplicationContext
>>>  INFO | Connector vm://localhost Started
>>>  INFO | Camel Console at http://0.0.0.0:8161/camel
>>>  INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
>>>  INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
>>>  INFO | Started SelectChannelConnector@0.0.0.0:8161
>>> ERROR | org.apache.camel.ExchangeTimedOutException: The OUT message was
>>> not
>>> received
>>> within: 20000 millis on the exchange: Exchange[JmsMessage:
>>> ActiveMQTextMessage {commandId
>>> = 5, responseRequired = true, messageId =
>>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1,
>>> originalDestination = null, originalTransactionId = null, producerId =
>>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1, destination =
>>> queue://myqueue123,
>>> transactionId = null, expiration = 0, timestamp = 1264698126199, arrival
>>> =
>>> 0, brokerInTime
>>> = 1264698126199, brokerOutTime = 1264698126292, correlationId =
>>> 990020100128180206199,
>>> replyTo = queue://myqueue555, persistent = true, type = Text, priority =
>>> 4,
>>> groupID = null, groupSequence = 0, targetConsumerId = null, compressed =
>>> false, userID =
>>> null, content = null, marshalledProperties =
>>> org.apache.activemq.util.ByteSequence@16c02df, dataStructure = null,
>>> redeliveryCounter =
>>> 0, size = 4076, properties = {msgselectr=000010}, readOnlyProperties =
>>> true,
>>> readOnlyBo
>>> dy = true, droppable = false, text = <aaa:globaltestframe
>>>        si1:schem...frametype>}]
>>> org.apache.camel.RuntimeCamelException:
>>> org.apache.camel.ExchangeTimedOutException: The
>>> OUT message was not received within: 20000 millis on the exchange:
>>> Exchange[JmsMessage:
>>> ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId =
>>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1, originalDestination = null,
>>> originalTransactionId = null, producerId =
>>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1,
>>> destination = queue://myqueue123, transactionId = null, expiration = 0,
>>> timestamp = 1264698126199, arrival = 0, brokerInTime = 1264698126199,
>>> brokerOutTime =
>>> 1264698126292, correlationId = 990020100128180206199, replyTo =
>>> queue://myqueue555, persistent = true, type = Text, priority = 4, groupID
>>> =
>>> null, groupSequence = 0, targetConsumerId = null, compressed = false,
>>> userID
>>> = null,
>>> content = null, marshalledProperties =
>>> org.apache.activemq.util.ByteSequence@16c02df,
>>> dataStructure = null, redeliveryCounter = 0, size = 4076, properties =
>>> {msgselectr=000010}, readO
>>> nlyProperties = true, readOnlyBody = true, droppable = false, text =
>>> <aaa:globaltestframe
>>>        si1:schem...frametype>}]
>>>        at
>>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011)
>>>        at
>>> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.j
>>> ava:103)
>>>        at
>>> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(Abstrac
>>> tMessageListenerContainer.java:543)
>>>        at
>>> --
>>> View this message in context:
>>> http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27369931.html
>>> Sent from the Camel - Users (activemq) mailing list archive at
>>> Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> 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
>>
>>
>
> --
> View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27370691.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
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

Re: How does Camel work with ActiveMQ ?

Posted by BenXS <bx...@yahoo.co.uk>.
Ok, thank you.

So duplication is not possible with Camel at all?

Or is this route command only the wrong way to achieve this?

I need simply a way to log all incoming JMS msgs in a certain queue to
either
- another queue
or alternatively
- an own xml file

The JMS msg should be (beside the logging) normally consumed by another
process.

How should I setup such a <route> config command?

Ben


Claus Ibsen-2 wrote:
> 
> On Fri, Jan 29, 2010 at 11:32 AM, BenXS <bx...@yahoo.co.uk> wrote:
>>
>> Ok, so I leave the <bean> active and specified as camelContext in
>> camel.xml
>> in activemq config dir:
>>
>> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>> <packageScan>
>>  <packages>org.foo.bar</packages>
>>  </packageScan>
>>  <route>
>>  <from uri="activemq:myqueue123" />
>>  <to uri="activemq:myqueue555" />
>>  </route>
>> </camelContext>
>>
>> In order to duplicate all incoming JMS msgs and put their clone into
>> another
>> queue myqueue555 on the same MessageBroker.
>>
>> Unfortunately when I sent now a message into myqueue123 then after a
>> couple
>> of seconds the following error messages appear in ActiveMQ window and the
>> messages were NOT duplicated as intended.
> 
> You are not duplicating messages, you are routing them. That is the
> way JMS works.
> When you consume a message from a queue its being removed from that
> queue. JMS do not do copies per see.
> 
> And about that exception. Its because your JMS message on the Queue
> have a JMSReplyTo set which makes Camel use request/reply over JMS.
> You can use option disableReplyTo=true when on the <to> endpoint to
> ignore JMSReplyTo.
> 
> 
>>
>> Why?
>>
>>  INFO | ActiveMQ WebConsole initialized.
>>  INFO | Initializing Spring FrameworkServlet 'dispatcher'
>>  INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
>>  INFO | Initializing Spring root WebApplicationContext
>>  INFO | Connector vm://localhost Started
>>  INFO | Camel Console at http://0.0.0.0:8161/camel
>>  INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
>>  INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
>>  INFO | Started SelectChannelConnector@0.0.0.0:8161
>> ERROR | org.apache.camel.ExchangeTimedOutException: The OUT message was
>> not
>> received
>> within: 20000 millis on the exchange: Exchange[JmsMessage:
>> ActiveMQTextMessage {commandId
>> = 5, responseRequired = true, messageId =
>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1,
>> originalDestination = null, originalTransactionId = null, producerId =
>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1, destination =
>> queue://myqueue123,
>> transactionId = null, expiration = 0, timestamp = 1264698126199, arrival
>> =
>> 0, brokerInTime
>> = 1264698126199, brokerOutTime = 1264698126292, correlationId =
>> 990020100128180206199,
>> replyTo = queue://myqueue555, persistent = true, type = Text, priority =
>> 4,
>> groupID = null, groupSequence = 0, targetConsumerId = null, compressed =
>> false, userID =
>> null, content = null, marshalledProperties =
>> org.apache.activemq.util.ByteSequence@16c02df, dataStructure = null,
>> redeliveryCounter =
>> 0, size = 4076, properties = {msgselectr=000010}, readOnlyProperties =
>> true,
>> readOnlyBo
>> dy = true, droppable = false, text = <aaa:globaltestframe
>>        si1:schem...frametype>}]
>> org.apache.camel.RuntimeCamelException:
>> org.apache.camel.ExchangeTimedOutException: The
>> OUT message was not received within: 20000 millis on the exchange:
>> Exchange[JmsMessage:
>> ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId =
>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1, originalDestination = null,
>> originalTransactionId = null, producerId =
>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1,
>> destination = queue://myqueue123, transactionId = null, expiration = 0,
>> timestamp = 1264698126199, arrival = 0, brokerInTime = 1264698126199,
>> brokerOutTime =
>> 1264698126292, correlationId = 990020100128180206199, replyTo =
>> queue://myqueue555, persistent = true, type = Text, priority = 4, groupID
>> =
>> null, groupSequence = 0, targetConsumerId = null, compressed = false,
>> userID
>> = null,
>> content = null, marshalledProperties =
>> org.apache.activemq.util.ByteSequence@16c02df,
>> dataStructure = null, redeliveryCounter = 0, size = 4076, properties =
>> {msgselectr=000010}, readO
>> nlyProperties = true, readOnlyBody = true, droppable = false, text =
>> <aaa:globaltestframe
>>        si1:schem...frametype>}]
>>        at
>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011)
>>        at
>> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.j
>> ava:103)
>>        at
>> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(Abstrac
>> tMessageListenerContainer.java:543)
>>        at
>> --
>> View this message in context:
>> http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27369931.html
>> Sent from the Camel - Users (activemq) mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> 
> -- 
> 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
> 
> 

-- 
View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27370691.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How does Camel work with ActiveMQ ?

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jan 29, 2010 at 11:32 AM, BenXS <bx...@yahoo.co.uk> wrote:
>
> Ok, so I leave the <bean> active and specified as camelContext in camel.xml
> in activemq config dir:
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
> <packageScan>
>  <packages>org.foo.bar</packages>
>  </packageScan>
>  <route>
>  <from uri="activemq:myqueue123" />
>  <to uri="activemq:myqueue555" />
>  </route>
> </camelContext>
>
> In order to duplicate all incoming JMS msgs and put their clone into another
> queue myqueue555 on the same MessageBroker.
>
> Unfortunately when I sent now a message into myqueue123 then after a couple
> of seconds the following error messages appear in ActiveMQ window and the
> messages were NOT duplicated as intended.

You are not duplicating messages, you are routing them. That is the
way JMS works.
When you consume a message from a queue its being removed from that
queue. JMS do not do copies per see.

And about that exception. Its because your JMS message on the Queue
have a JMSReplyTo set which makes Camel use request/reply over JMS.
You can use option disableReplyTo=true when on the <to> endpoint to
ignore JMSReplyTo.


>
> Why?
>
>  INFO | ActiveMQ WebConsole initialized.
>  INFO | Initializing Spring FrameworkServlet 'dispatcher'
>  INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
>  INFO | Initializing Spring root WebApplicationContext
>  INFO | Connector vm://localhost Started
>  INFO | Camel Console at http://0.0.0.0:8161/camel
>  INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
>  INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
>  INFO | Started SelectChannelConnector@0.0.0.0:8161
> ERROR | org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received
> within: 20000 millis on the exchange: Exchange[JmsMessage:
> ActiveMQTextMessage {commandId
> = 5, responseRequired = true, messageId =
> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1, destination = queue://myqueue123,
> transactionId = null, expiration = 0, timestamp = 1264698126199, arrival =
> 0, brokerInTime
> = 1264698126199, brokerOutTime = 1264698126292, correlationId =
> 990020100128180206199,
> replyTo = queue://myqueue555, persistent = true, type = Text, priority = 4,
> groupID = null, groupSequence = 0, targetConsumerId = null, compressed =
> false, userID =
> null, content = null, marshalledProperties =
> org.apache.activemq.util.ByteSequence@16c02df, dataStructure = null,
> redeliveryCounter =
> 0, size = 4076, properties = {msgselectr=000010}, readOnlyProperties = true,
> readOnlyBo
> dy = true, droppable = false, text = <aaa:globaltestframe
>        si1:schem...frametype>}]
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.ExchangeTimedOutException: The
> OUT message was not received within: 20000 millis on the exchange:
> Exchange[JmsMessage:
> ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId =
> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1,
> destination = queue://myqueue123, transactionId = null, expiration = 0,
> timestamp = 1264698126199, arrival = 0, brokerInTime = 1264698126199,
> brokerOutTime =
> 1264698126292, correlationId = 990020100128180206199, replyTo =
> queue://myqueue555, persistent = true, type = Text, priority = 4, groupID =
> null, groupSequence = 0, targetConsumerId = null, compressed = false, userID
> = null,
> content = null, marshalledProperties =
> org.apache.activemq.util.ByteSequence@16c02df,
> dataStructure = null, redeliveryCounter = 0, size = 4076, properties =
> {msgselectr=000010}, readO
> nlyProperties = true, readOnlyBody = true, droppable = false, text =
> <aaa:globaltestframe
>        si1:schem...frametype>}]
>        at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011)
>        at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.j
> ava:103)
>        at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(Abstrac
> tMessageListenerContainer.java:543)
>        at
> --
> View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27369931.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
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

Re: How does Camel work with ActiveMQ ?

Posted by BenXS <bx...@yahoo.co.uk>.
Ok, so I leave the <bean> active and specified as camelContext in camel.xml
in activemq config dir:

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<packageScan>
  <packages>org.foo.bar</packages> 
  </packageScan>
 <route>
  <from uri="activemq:myqueue123" /> 
  <to uri="activemq:myqueue555" /> 
 </route>
</camelContext>

In order to duplicate all incoming JMS msgs and put their clone into another
queue myqueue555 on the same MessageBroker.

Unfortunately when I sent now a message into myqueue123 then after a couple
of seconds the following error messages appear in ActiveMQ window and the
messages were NOT duplicated as intended.

Why?

 INFO | ActiveMQ WebConsole initialized.
 INFO | Initializing Spring FrameworkServlet 'dispatcher'
 INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
 INFO | Initializing Spring root WebApplicationContext
 INFO | Connector vm://localhost Started
 INFO | Camel Console at http://0.0.0.0:8161/camel
 INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
 INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
 INFO | Started SelectChannelConnector@0.0.0.0:8161
ERROR | org.apache.camel.ExchangeTimedOutException: The OUT message was not
received
within: 20000 millis on the exchange: Exchange[JmsMessage:
ActiveMQTextMessage {commandId
= 5, responseRequired = true, messageId =
ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1,
originalDestination = null, originalTransactionId = null, producerId =
ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1, destination = queue://myqueue123,
transactionId = null, expiration = 0, timestamp = 1264698126199, arrival =
0, brokerInTime
= 1264698126199, brokerOutTime = 1264698126292, correlationId =
990020100128180206199,
replyTo = queue://myqueue555, persistent = true, type = Text, priority = 4,
groupID = null, groupSequence = 0, targetConsumerId = null, compressed =
false, userID =
null, content = null, marshalledProperties =
org.apache.activemq.util.ByteSequence@16c02df, dataStructure = null,
redeliveryCounter =
0, size = 4076, properties = {msgselectr=000010}, readOnlyProperties = true,
readOnlyBo
dy = true, droppable = false, text = <aaa:globaltestframe
        si1:schem...frametype>}]
org.apache.camel.RuntimeCamelException:
org.apache.camel.ExchangeTimedOutException: The
OUT message was not received within: 20000 millis on the exchange:
Exchange[JmsMessage:
ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId =
ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1,
destination = queue://myqueue123, transactionId = null, expiration = 0,
timestamp = 1264698126199, arrival = 0, brokerInTime = 1264698126199,
brokerOutTime =
1264698126292, correlationId = 990020100128180206199, replyTo =
queue://myqueue555, persistent = true, type = Text, priority = 4, groupID =
null, groupSequence = 0, targetConsumerId = null, compressed = false, userID
= null,
content = null, marshalledProperties =
org.apache.activemq.util.ByteSequence@16c02df,
dataStructure = null, redeliveryCounter = 0, size = 4076, properties =
{msgselectr=000010}, readO
nlyProperties = true, readOnlyBody = true, droppable = false, text =
<aaa:globaltestframe
        si1:schem...frametype>}]
        at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011)
        at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.j
ava:103)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(Abstrac
tMessageListenerContainer.java:543)
        at
-- 
View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27369931.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How does Camel work with ActiveMQ ?

Posted by Willem Jiang <wi...@gmail.com>.
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
> 

Re: How does Camel work with ActiveMQ ?

Posted by BenXS <bx...@yahoo.co.uk>.
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?

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


janstey wrote:
> 
> Here is some AMQ documentation about that
> http://activemq.apache.org/enterprise-integration-patterns.html
> 
> On Tue, Jan 26, 2010 at 12:57 PM, Claus Ibsen <cl...@gmail.com>
> wrote:
> 
>> On Tue, Jan 26, 2010 at 5:21 PM, BenXS <bx...@yahoo.co.uk> wrote:
>> >
>> > Hi Ashwin,
>> > thank you for response. But this procedure seems to me rather
>> long-winded.
>> >
>> > Do I really need Spring?
>> > Are there really no pre-compiled, ready-to-use *.jars of Camel?
>> >
>> > What I expect is a camel.jar which I have to put into the target
>> > applications (here: ActiveMQ) "lib" subdirectory. Secondly a
>> > camel-config.xml where the user should specify what to log and to do
>> with
>> > the JMS msgs.
>> >
>> > That should be all.
>> >
>> > Is this somehow possible?
>> >
>>
>> Yeah Camel is included by default in ActiveMQ. There should be a
>> sample camel XML file in AMQ you can take a peak at.
>> Then just drop your camel app in the lib folder of AMQ.
>>
>> There should be some docu about this at the AMQ website
>>
>> > Ben
>> >
>> >
>> > Ashwin Karpe wrote:
>> >>
>> >> Here is a quick response to the general steps.
>> >>     a> Start the ActiveMQ Broker. It typically comes up on
>> >> tcp://localhost:61616
>> >>     b> Check out the example
>> >> <camel-install-dir>/examples/camel-example-spring-jms. This example is
>> >> available in the 1.6 version of Camel.
>> >>     c> Build and deploy into a Spring container
>> >>
>> >
>> > --
>> > View this message in context:
>> http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27325345.html
>> > Sent from the Camel - Users (activemq) mailing list archive at
>> Nabble.com.
>> >
>> >
>>
>>
>>
>> --
>> 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
>>
> -- 
> Cheers,
> Jon
> 
> Camel in Action: http://manning.com/ibsen
> Blog: http://janstey.blogspot.com
> 
> 

-- 
View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27335621.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How does Camel work with ActiveMQ ?

Posted by Jon Anstey <ja...@gmail.com>.
Here is some AMQ documentation about that
http://activemq.apache.org/enterprise-integration-patterns.html

On Tue, Jan 26, 2010 at 12:57 PM, Claus Ibsen <cl...@gmail.com> wrote:

> On Tue, Jan 26, 2010 at 5:21 PM, BenXS <bx...@yahoo.co.uk> wrote:
> >
> > Hi Ashwin,
> > thank you for response. But this procedure seems to me rather
> long-winded.
> >
> > Do I really need Spring?
> > Are there really no pre-compiled, ready-to-use *.jars of Camel?
> >
> > What I expect is a camel.jar which I have to put into the target
> > applications (here: ActiveMQ) "lib" subdirectory. Secondly a
> > camel-config.xml where the user should specify what to log and to do with
> > the JMS msgs.
> >
> > That should be all.
> >
> > Is this somehow possible?
> >
>
> Yeah Camel is included by default in ActiveMQ. There should be a
> sample camel XML file in AMQ you can take a peak at.
> Then just drop your camel app in the lib folder of AMQ.
>
> There should be some docu about this at the AMQ website
>
> > Ben
> >
> >
> > Ashwin Karpe wrote:
> >>
> >> Here is a quick response to the general steps.
> >>     a> Start the ActiveMQ Broker. It typically comes up on
> >> tcp://localhost:61616
> >>     b> Check out the example
> >> <camel-install-dir>/examples/camel-example-spring-jms. This example is
> >> available in the 1.6 version of Camel.
> >>     c> Build and deploy into a Spring container
> >>
> >
> > --
> > View this message in context:
> http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27325345.html
> > Sent from the Camel - Users (activemq) mailing list archive at
> Nabble.com.
> >
> >
>
>
>
> --
> 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
>



-- 
Cheers,
Jon

Camel in Action: http://manning.com/ibsen
Blog: http://janstey.blogspot.com

Re: How does Camel work with ActiveMQ ?

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 26, 2010 at 5:21 PM, BenXS <bx...@yahoo.co.uk> wrote:
>
> Hi Ashwin,
> thank you for response. But this procedure seems to me rather long-winded.
>
> Do I really need Spring?
> Are there really no pre-compiled, ready-to-use *.jars of Camel?
>
> What I expect is a camel.jar which I have to put into the target
> applications (here: ActiveMQ) "lib" subdirectory. Secondly a
> camel-config.xml where the user should specify what to log and to do with
> the JMS msgs.
>
> That should be all.
>
> Is this somehow possible?
>

Yeah Camel is included by default in ActiveMQ. There should be a
sample camel XML file in AMQ you can take a peak at.
Then just drop your camel app in the lib folder of AMQ.

There should be some docu about this at the AMQ website

> Ben
>
>
> Ashwin Karpe wrote:
>>
>> Here is a quick response to the general steps.
>>     a> Start the ActiveMQ Broker. It typically comes up on
>> tcp://localhost:61616
>>     b> Check out the example
>> <camel-install-dir>/examples/camel-example-spring-jms. This example is
>> available in the 1.6 version of Camel.
>>     c> Build and deploy into a Spring container
>>
>
> --
> View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27325345.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
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

Re: How does Camel work with ActiveMQ ?

Posted by Stan Lewis <ga...@gmail.com>.
ActiveMQ ships with camel-core.jar already, if you take a look at the
default activemq.xml file from a fresh ActiveMQ install you'll see
there's a camel context configured with a couple example routes, so if
you want you can have your routes in-process in the broker.  Hope that
helps!

On Tue, Jan 26, 2010 at 11:21 AM, BenXS <bx...@yahoo.co.uk> wrote:
>
> Hi Ashwin,
> thank you for response. But this procedure seems to me rather long-winded.
>
> Do I really need Spring?
> Are there really no pre-compiled, ready-to-use *.jars of Camel?
>
> What I expect is a camel.jar which I have to put into the target
> applications (here: ActiveMQ) "lib" subdirectory. Secondly a
> camel-config.xml where the user should specify what to log and to do with
> the JMS msgs.
>
> That should be all.
>
> Is this somehow possible?
>
> Ben
>
>
> Ashwin Karpe wrote:
>>
>> Here is a quick response to the general steps.
>>     a> Start the ActiveMQ Broker. It typically comes up on
>> tcp://localhost:61616
>>     b> Check out the example
>> <camel-install-dir>/examples/camel-example-spring-jms. This example is
>> available in the 1.6 version of Camel.
>>     c> Build and deploy into a Spring container
>>
>
> --
> View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27325345.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>

Re: How does Camel work with ActiveMQ ?

Posted by BenXS <bx...@yahoo.co.uk>.
Hi Ashwin,
thank you for response. But this procedure seems to me rather long-winded.

Do I really need Spring?
Are there really no pre-compiled, ready-to-use *.jars of Camel?

What I expect is a camel.jar which I have to put into the target
applications (here: ActiveMQ) "lib" subdirectory. Secondly a
camel-config.xml where the user should specify what to log and to do with
the JMS msgs.

That should be all.

Is this somehow possible?

Ben


Ashwin Karpe wrote:
> 
> Here is a quick response to the general steps.
>     a> Start the ActiveMQ Broker. It typically comes up on
> tcp://localhost:61616
>     b> Check out the example
> <camel-install-dir>/examples/camel-example-spring-jms. This example is
> available in the 1.6 version of Camel.
>     c> Build and deploy into a Spring container
> 

-- 
View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27325345.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How does Camel work with ActiveMQ ?

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Here is a quick response to the general steps.
    a> Start the ActiveMQ Broker. It typically comes up on
tcp://localhost:61616
    b> Check out the example
<camel-install-dir>/examples/camel-example-spring-jms. This example is
available in the 1.6 version of Camel.
    c> Build and deploy into a Spring container

Cheers,

Ashwin..

BenXS wrote:
> 
> From pages like 
> 
> http://camel.apache.org/wire-tap.html
> 
> I tried to figure out on how Camel works in ActiveMQ.
> 
> Say I have a running ActiveMQ installation and I want to save a copy of
> every JSM msg wihc arrives in
> the queue mytestqueue123 into a separate XML file in directory
> D:\testcamel
> 
> How do I setup and integrate Camel into ActiveMQ to achieve this?
> Unfortunately there is no quick intro for this test scenario.
> 
> Ben
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27322126.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.