You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sandp <sa...@gmail.com> on 2014/10/01 21:46:23 UTC

camel-quartz2 2.14.0 as a polling consumer for a JMS Queue

Hi,
Is is possible to use quartz2 as a polling consumer to poll a JMS Queue? Or
what is the best camel way to poll a queue with a CRON job?

I'm looking for something that is possible with file and ftp  under section*
Using QuartzScheduledPollConsumerScheduler *in the link below:

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Apache_Camel_Component_Reference/files/_IDU_Quartz2.html

I tried it but didn't work:
*Route:*

from("jms:queue:ctsCamelQueue?*scheduler=quartz2*&scheduler.cron=0+0/1+*+*+*+?+*&scheduler.job.name=unqualifiedTransactionBidsJob")

*Exception:*
Failed to resolve endpoint:
jms://queue:ctsCamelQueue?scheduler=quartz2&scheduler.cron=0+0%2F1+*+*+*+%3F+*&scheduler.job.name=unqualifiedTransactionBidsJob
due to: There are 3 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{scheduler=quartz2, scheduler.cron=0
0/1 * * * ? *, scheduler.job.name=unqualifiedTransactionBidsJob}]



--
View this message in context: http://camel.465427.n5.nabble.com/camel-quartz2-2-14-0-as-a-polling-consumer-for-a-JMS-Queue-tp5757292.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Rép. : camel-quartz2 2.14.0 as a polling consumer for a JMS Queue

Posted by Thierry RABUEL <TR...@cora.fr>.
Hello,
 
I can't say what is best for jms polling with a scheduled task. But
you're not using the quartz2 component the right way.
You should have a look at the documentation :
http://camel.apache.org/quartz2.html
 
Your route should start something like this : 
from("quartz2://myGroup/unqualifiedTransactionBidsJob?cron=0+0/1+*+*+*+?+*")
Then I guess you should use a processor to poll from ths jms queue.
 
Thierry


>>> 


De : sandp <sa...@gmail.com>
À :<us...@camel.apache.org>
Date : 02/10/2014 08:19
Objet : camel-quartz2 2.14.0  as a polling consumer for a JMS Queue
Hi,
Is is possible to use quartz2 as a polling consumer to poll a JMS
Queue? Or
what is the best camel way to poll a queue with a CRON job?

I'm looking for something that is possible with file and ftp  under
section*
Using QuartzScheduledPollConsumerScheduler *in the link below:

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Apache_Camel_Component_Reference/files/_IDU_Quartz2.html

I tried it but didn't work:
*Route:*

from("jms:queue:ctsCamelQueue?*scheduler=quartz2*&scheduler.cron=0+0/1+*+*+*+?+*&scheduler.job.name=unqualifiedTransactionBidsJob")

*Exception:*
Failed to resolve endpoint:
jms://queue:ctsCamelQueue?scheduler=quartz2&scheduler.cron=0+0%2F1+*+*+*+%3F+*&scheduler.job.name=unqualifiedTransactionBidsJob
due to: There are 3 parameters that couldn't be set on the endpoint.
Check
the uri if the parameters are spelt correctly and that they are
properties
of the endpoint. Unknown parameters=[{scheduler=quartz2,
scheduler.cron=0
0/1 * * * ? *, scheduler.job.name=unqualifiedTransactionBidsJob}]



--
View this message in context:
http://camel.465427.n5.nabble.com/camel-quartz2-2-14-0-as-a-polling-consumer-for-a-JMS-Queue-tp5757292.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-quartz2 2.14.0 as a polling consumer for a JMS Queue

Posted by Charles Moulliard <ch...@gmail.com>.
Hi,

You can't mix parameters of the JMS endpoint with the Quartz endpoint like
you did. To be able to define when you would like to poll a queue, you
should use the quartz2 endpoint with the enrich poll EIP partner

from("quartz2:...")
.pollEnrich("jms:queue:...")
.to("")

Regards,

On Wed, Oct 1, 2014 at 9:46 PM, sandp <sa...@gmail.com> wrote:

> Hi,
> Is is possible to use quartz2 as a polling consumer to poll a JMS Queue? Or
> what is the best camel way to poll a queue with a CRON job?
>
> I'm looking for something that is possible with file and ftp  under
> section*
> Using QuartzScheduledPollConsumerScheduler *in the link below:
>
>
> https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Apache_Camel_Component_Reference/files/_IDU_Quartz2.html
>
> I tried it but didn't work:
> *Route:*
>
>
> from("jms:queue:ctsCamelQueue?*scheduler=quartz2*&scheduler.cron=0+0/1+*+*+*+?+*&
> scheduler.job.name=unqualifiedTransactionBidsJob")
>
> *Exception:*
> Failed to resolve endpoint:
>
> jms://queue:ctsCamelQueue?scheduler=quartz2&scheduler.cron=0+0%2F1+*+*+*+%3F+*&
> scheduler.job.name=unqualifiedTransactionBidsJob
> due to: There are 3 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties
> of the endpoint. Unknown parameters=[{scheduler=quartz2, scheduler.cron=0
> 0/1 * * * ? *, scheduler.job.name=unqualifiedTransactionBidsJob}]
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-quartz2-2-14-0-as-a-polling-consumer-for-a-JMS-Queue-tp5757292.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: camel-quartz2 2.14.0 as a polling consumer for a JMS Queue

Posted by sandp <sa...@gmail.com>.
Thank Claus that helped.

I'm trying to set a property below for Scheduled Delivery just before
delivering to HornetQ 
*_JBM_SCHED_DELIVERY*

I tried setting the property as a Header and Property on the Exchange
Message neither worked. Is there is a camel option that can recognize a
schedule?



--
View this message in context: http://camel.465427.n5.nabble.com/camel-quartz2-2-14-0-as-a-polling-consumer-for-a-JMS-Queue-tp5757292p5757332.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-quartz2 2.14.0 as a polling consumer for a JMS Queue

Posted by Claus Ibsen <cl...@gmail.com>.
The JMS consumer is event driven so it reacts when a new message is on
the queue. It only makes sense to use a CRON if you want to use that
to control when the route is active and when its not active.

For that see about route policy
http://camel.apache.org/routepolicy

On Wed, Oct 1, 2014 at 9:46 PM, sandp <sa...@gmail.com> wrote:
> Hi,
> Is is possible to use quartz2 as a polling consumer to poll a JMS Queue? Or
> what is the best camel way to poll a queue with a CRON job?
>
> I'm looking for something that is possible with file and ftp  under section*
> Using QuartzScheduledPollConsumerScheduler *in the link below:
>
> https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Apache_Camel_Component_Reference/files/_IDU_Quartz2.html
>
> I tried it but didn't work:
> *Route:*
>
> from("jms:queue:ctsCamelQueue?*scheduler=quartz2*&scheduler.cron=0+0/1+*+*+*+?+*&scheduler.job.name=unqualifiedTransactionBidsJob")
>
> *Exception:*
> Failed to resolve endpoint:
> jms://queue:ctsCamelQueue?scheduler=quartz2&scheduler.cron=0+0%2F1+*+*+*+%3F+*&scheduler.job.name=unqualifiedTransactionBidsJob
> due to: There are 3 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties
> of the endpoint. Unknown parameters=[{scheduler=quartz2, scheduler.cron=0
> 0/1 * * * ? *, scheduler.job.name=unqualifiedTransactionBidsJob}]
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-quartz2-2-14-0-as-a-polling-consumer-for-a-JMS-Queue-tp5757292.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/