You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by trilochan237 <ka...@gmail.com> on 2013/12/03 12:59:16 UTC
Need Help in Quartz Scheduler
Hi
I have written a sample program which will trigger the messages for every 10
sec and the program is as follows.
The issue i am facing is i am not able to see any action from the program
when executed.
Code:
public class QuartzFileCopierWithCamel {
public static void main(String args[]) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {
from("quartz://report?cron=0/30 * * * * ?")
.to("file:data/inbox?noop=true")
.process(new Processor() {
@Override
public void process(Exchange arg0)
throws Exception {
System.out.println("Quartz
scheduler is started");
}
})
.to("file:data/outbox");
}
});
context.start();
Thread.sleep(3000);
System.out.println("context started and running");
}
}
--
View this message in context: http://camel.465427.n5.nabble.com/Need-Help-in-Quartz-Scheduler-tp5744239.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Need Help in Quartz Scheduler
Posted by Claus Ibsen <cl...@gmail.com>.
You do not set any message body after the quarts trigger which means
there is nothing to write in the file.
Try setting the body as empty / some text
from
.transform(constant("Hello World"))
.to file
On Tue, Dec 3, 2013 at 12:59 PM, trilochan237
<ka...@gmail.com> wrote:
> Hi
> I have written a sample program which will trigger the messages for every 10
> sec and the program is as follows.
> The issue i am facing is i am not able to see any action from the program
> when executed.
>
> Code:
> public class QuartzFileCopierWithCamel {
> public static void main(String args[]) throws Exception {
> CamelContext context = new DefaultCamelContext();
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> from("quartz://report?cron=0/30 * * * * ?")
> .to("file:data/inbox?noop=true")
> .process(new Processor() {
> @Override
> public void process(Exchange arg0)
> throws Exception {
> System.out.println("Quartz
> scheduler is started");
> }
> })
> .to("file:data/outbox");
>
> }
> });
>
> context.start();
> Thread.sleep(3000);
> System.out.println("context started and running");
> }
> }
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Need-Help-in-Quartz-Scheduler-tp5744239.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