You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michiel Borkent <mi...@gmail.com> on 2013/11/28 20:36:20 UTC
Delivering messages from one activemq to another transactionally
triggered by mbean
Say I have two queues (implementation ActiveMQ) A and B. I want to be able to
invoke a method via an MBean that transfers all messages from A to B
transactionally. What is the most common way to implement this in Camel /
Fuse ESB?
--
View this message in context: http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Delivering messages from one activemq to another
transactionally triggered by mbean
Posted by Michiel Borkent <mi...@gmail.com>.
Btw, the transaction has just to be around one message, not all the messages.
--
View this message in context: http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049p5744050.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Delivering messages from one activemq to another
transactionally triggered by mbean
Posted by Michiel Borkent <mi...@gmail.com>.
Hello Claus,
I googled some more and also found this example on Stackoverflow:
http://stackoverflow.com/questions/9078621/controlling-start-up-and-shutdown-of-camel-routes
The accepted answer drains a queue. This is exactly what I want, only
not triggered by a timer, but by sending a message to a direct caused
by JMX. Is there a way to make this example transactional per message,
or doesn't this make sense at all?
On Fri, Nov 29, 2013 at 7:53 AM, Claus Ibsen-2 [via Camel]
<ml...@n5.nabble.com> wrote:
> No the jms component takes one message at a time.
>
> You need to stop it manually or let it keep running even if the queue is
> empty,
> or figure out if the queue is empty and then stop the route.
>
>
> On Thu, Nov 28, 2013 at 10:19 PM, Michiel Borkent
> <[hidden email]> wrote:
>
>> Hello Claus,
>>
>> Thanks for your answer. This sounds simpler than I thought.
>>
>> Just to be sure, is it safe to assume that
>>
>> Given: there is a route A -> B that is not auto started and has the
>> ShutdownStrategy ShutdownRunningTask.CompleteAllTasks
>>
>> When there are X messages at queue A
>> and the route is turned on and immediately turned off again (for example
>> by
>> JMX but this is a detail that shouldn't matter much)
>>
>> normally all X messages will be delivered to queue B?
>>
>> Kind regards,
>>
>> Michiel
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049p5744054.html
>
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [hidden email]
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049p5744063.html
> To unsubscribe from Delivering messages from one activemq to another
> transactionally triggered by mbean, click here.
> NAML
--
http://www.michielborkent.nl
http://www.eetvoorjeleven.nu
--
View this message in context: http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049p5744065.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Delivering messages from one activemq to another transactionally
triggered by mbean
Posted by Claus Ibsen <cl...@gmail.com>.
No the jms component takes one message at a time.
You need to stop it manually or let it keep running even if the queue is empty,
or figure out if the queue is empty and then stop the route.
On Thu, Nov 28, 2013 at 10:19 PM, Michiel Borkent
<mi...@gmail.com> wrote:
> Hello Claus,
>
> Thanks for your answer. This sounds simpler than I thought.
>
> Just to be sure, is it safe to assume that
>
> Given: there is a route A -> B that is not auto started and has the
> ShutdownStrategy ShutdownRunningTask.CompleteAllTasks
>
> When there are X messages at queue A
> and the route is turned on and immediately turned off again (for example by
> JMX but this is a detail that shouldn't matter much)
>
> normally all X messages will be delivered to queue B?
>
> Kind regards,
>
> Michiel
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049p5744054.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Delivering messages from one activemq to another
transactionally triggered by mbean
Posted by Michiel Borkent <mi...@gmail.com>.
Hello Claus,
Thanks for your answer. This sounds simpler than I thought.
Just to be sure, is it safe to assume that
Given: there is a route A -> B that is not auto started and has the
ShutdownStrategy ShutdownRunningTask.CompleteAllTasks
When there are X messages at queue A
and the route is turned on and immediately turned off again (for example by
JMX but this is a detail that shouldn't matter much)
normally all X messages will be delivered to queue B?
Kind regards,
Michiel
--
View this message in context: http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049p5744054.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Delivering messages from one activemq to another transactionally
triggered by mbean
Posted by Claus Ibsen <cl...@gmail.com>.
You can just have a Camel route that is from -> to and use the vm
transport of the broker if using the embedded broker in the same jvm.
Then you can start|stop the route using JMX or using the shell with
the camel:start-route | stop-route commands. Or use the web ui to do
that as well.
You can also use jms transactions though that often makes more sense
to use if its a remote broker or you do more work with the message.
On Thu, Nov 28, 2013 at 8:36 PM, Michiel Borkent
<mi...@gmail.com> wrote:
> Say I have two queues (implementation ActiveMQ) A and B. I want to be able to
> invoke a method via an MBean that transfers all messages from A to B
> transactionally. What is the most common way to implement this in Camel /
> Fuse ESB?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Delivering-messages-from-one-activemq-to-another-transactionally-triggered-by-mbean-tp5744049.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen