You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by marcin80 <mt...@gmail.com> on 2010/01/08 10:37:54 UTC

camel quartz

Hi

I would like to know how to create quartz jobs dynamically? My case is
following:
I have a message consumer witch consume messages from queue and each message
should be proces at specific time defined in message property. So I would
like use somethig like this:

<route>
 <from uri="activemq:queue:test"/>
 <!-- here I would like to create quartz jobs for each message triggering
message processing in specific time but I don't know how to do it (maybe it
is impossible?)-->

</route>

Can I do it?

Cheers,
Marcin
-- 
View this message in context: http://old.nabble.com/camel-quartz-tp27073449p27073449.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel quartz

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jan 8, 2010 at 2:14 PM, marcin80 <mt...@gmail.com> wrote:
>
> Hi Claus,
>
> Thank you  for your response.
>
> Time interval will be changeable for each task but range is 1 day - 1 week.
>

Ah okay then I assume you can use some sort of persistent quartz to
store the trigger time and the message content.
Then you need a database to store that. But then quartz should be able
to schedule and trigger those jobs accordingly.

I was just looking if you would keep that info in memory only and thus
suffer from lost messages in case of crash etc.
So keeping the messages on the JMS Broker would then be a better choice.

But the persistent of quartz will do as well.


> Cheers,
> Marcin
> --
> View this message in context: http://old.nabble.com/camel-quartz-tp27073449p27075754.html
> Sent from the Camel - Users 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: camel quartz

Posted by marcin80 <mt...@gmail.com>.
Hi Claus, 

Thank you  for your response.

Time interval will be changeable for each task but range is 1 day - 1 week. 

Cheers,
Marcin
-- 
View this message in context: http://old.nabble.com/camel-quartz-tp27073449p27075754.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel quartz

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jan 8, 2010 at 10:37 AM, marcin80 <mt...@gmail.com> wrote:
>
> Hi
>
> I would like to know how to create quartz jobs dynamically? My case is
> following:
> I have a message consumer witch consume messages from queue and each message
> should be proces at specific time defined in message property. So I would
> like use somethig like this:
>
> <route>
>  <from uri="activemq:queue:test"/>
>  <!-- here I would like to create quartz jobs for each message triggering
> message processing in specific time but I don't know how to do it (maybe it
> is impossible?)-->
>
> </route>
>
> Can I do it?
>

How long time in the future should those tasks be executed? It will
assume its better to keep the messages in the JMS Broker until the
time is due before they are visible for the consumers. JMS have such a
feature. Cant remember exact details about it.

Anyway you can use regular Quartz to schedule tasks. So just route to
a bean or Processor and do the code in Java to schedule it with
Quartz.
To continue routing the message from that task you can use
ProducerTemplate to send it back to Camel.

We do however have a ticket about being able to send a message to
camel-quartz endpoint and have it schedule the tasks for the future
and which destination to send to
https://issues.apache.org/activemq/browse/CAMEL-1185

Use the JIRA voting system to let us know which tickets is important
for the community.

And as always we love contributions so if anyone is up for it then try
make that feature and submit patches to back to Apache.


> Cheers,
> Marcin
> --
> View this message in context: http://old.nabble.com/camel-quartz-tp27073449p27073449.html
> Sent from the Camel - Users 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