You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by icemanltd <ic...@hotmail.com> on 2013/06/11 21:41:20 UTC

Is Quartz component a scheduled polling component?

Maybe I am misreading the polling consumer documentation  here
<http://camel.apache.org/polling-consumer.html>  ? It looks like the Quartz
component should be a ScheduledPollConsumer and thus support the
pollStrategy attribute but when I try it in my Spring DSL it reports the
pollStrategy as an unsupported property.

My route looks like
<route>
    <from uri="quartz://myTimer?cron=0 * * * * ?
*&amp;pollStrategy=#resourceBasedPoller"/>
    <pollEnrich uri="activemq://queue:NewFilesQueue"/>
....
</route>

Is the documentation wrong, am I misunderstanding it or am I not using it
properly?

Regardless, I am trying to control messages being picked up off the queue.
My polling strategy would check some system/resource availability and
decline the poll if not ready. Maybe there is a better way to do it?



--
View this message in context: http://camel.465427.n5.nabble.com/Is-Quartz-component-a-scheduled-polling-component-tp5734111.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Is Quartz component a scheduled polling component?

Posted by icemanltd <ic...@hotmail.com>.
please post

Date: Wed, 12 Jun 2013 06:11:23 -0700
From: ml-node+s465427n5734134h52@n5.nabble.com
To: icemanltd@hotmail.com
Subject: Re: Is Quartz component a scheduled polling component?



	Thank you for your response. I had exactly what I wanted with a file endpoint and wanted to extend that to a jms endpoint. I guess am misunderstanding the documentation. Anyway, I think I have accomplished what I wanted to do using consumer/producer templates and a bean.


The route looks like


        <route id="Test">
            <from uri="timer://foo?period=10000"/>
            <to uri="bean:testBean?method=consumeIfAble"/> 

            <log message="test has started"/>
        </route>

And, in the consumeIfAble method I check on resource requirements and if they are met I consume from the activemq endpoint and if there was any message, send it directly to another endpoint.


consumer.receive("activemq://queue:NewFileQueue", 1000)

producer.sendBody("direct:test", message)


I think this is a reasonable alternative?

	
	
	
	

	

	
	
		If you reply to this email, your message will be added to the discussion below:
		http://camel.465427.n5.nabble.com/Is-Quartz-component-a-scheduled-polling-component-tp5734111p5734134.html
	
	
		
		To unsubscribe from Is Quartz component a scheduled polling component?, click here.

		NAML
	 		 	   		  



--
View this message in context: http://camel.465427.n5.nabble.com/Is-Quartz-component-a-scheduled-polling-component-tp5734111p5734135.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is Quartz component a scheduled polling component?

Posted by Yuvrajyr <yu...@gmail.com>.
Can We achieve transactione here in the below methods :

consumer.receive("activemq://queue:NewFileQueue", 1000) 
producer.sendBody("direct:test", message) 



--
View this message in context: http://camel.465427.n5.nabble.com/Is-Quartz-component-a-scheduled-polling-component-tp5734111p5755645.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is Quartz component a scheduled polling component?

Posted by icemanltd <ic...@hotmail.com>.
Thank you for your response. I had exactly what I wanted with a file endpoint
and wanted to extend that to a jms endpoint. I guess am misunderstanding the
documentation. Anyway, I think I have accomplished what I wanted to do using
consumer/producer templates and a bean.

The route looks like

        <route id="Test">
            <from uri="timer://foo?period=10000"/>
            <to uri="bean:testBean?method=consumeIfAble"/> 
            <log message="test has started"/>
        </route>

And, in the consumeIfAble method I check on resource requirements and if
they are met I consume from the activemq endpoint and if there was any
message, send it directly to another endpoint.

consumer.receive("activemq://queue:NewFileQueue", 1000)
producer.sendBody("direct:test", message)

I think this is a reasonable alternative?



--
View this message in context: http://camel.465427.n5.nabble.com/Is-Quartz-component-a-scheduled-polling-component-tp5734111p5734134.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is Quartz component a scheduled polling component?

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

Quartz Camel component is not a polling component but a component able to
schedule 'using cron strategy of Quartz' delivery of messages.
As a jms/activemq client/camel component listens on a queue and is created
by default when placed in the from() of a camel route, the only way to
achieve your goal is to start/stop a camel route reading messages from a
queue according to a policy or perhaps using a scheduled route policy (
http://camel.apache.org/cronscheduledroutepolicy.html)

Regards,


On Tue, Jun 11, 2013 at 9:41 PM, icemanltd <ic...@hotmail.com> wrote:

> Maybe I am misreading the polling consumer documentation  here
> <http://camel.apache.org/polling-consumer.html>  ? It looks like the
> Quartz
> component should be a ScheduledPollConsumer and thus support the
> pollStrategy attribute but when I try it in my Spring DSL it reports the
> pollStrategy as an unsupported property.
>
> My route looks like
> <route>
>     <from uri="quartz://myTimer?cron=0 * * * * ?
> *&pollStrategy=#resourceBasedPoller"/>
>     <pollEnrich uri="activemq://queue:NewFilesQueue"/>
> ....
> </route>
>
> Is the documentation wrong, am I misunderstanding it or am I not using it
> properly?
>
> Regardless, I am trying to control messages being picked up off the queue.
> My polling strategy would check some system/resource availability and
> decline the poll if not ready. Maybe there is a better way to do it?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Is-Quartz-component-a-scheduled-polling-component-tp5734111.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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