You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by huntc <hu...@mac.com> on 2008/10/08 13:50:51 UTC

Unexpected batch processor polling thread

Hi there,

I have debug logging enabled for Camel and notice that there's a polling
thread executing every second. What did I do to cause this polling thread to
exist?

The log shows the following:


[tTimeTables])]] Polling Thread] BeanInfo                       DEBUG No
expression available for method: public java.util.Collection
com.classactionpl.flighttimes.InMemoryFlightTimesService.getFlightsForDay(com.classactionpl.flighttimes.FlightTimesService$QueryType,java.lang.String,java.lang.String,java.lang.String,int,int,int,java.util.TimeZone)
which already has a body so ignoring parameter: 1 so ignoring method
[tTimeTables])]] Polling Thread] BeanInfo                       DEBUG No
expression available for method: public abstract java.util.Collection
com.classactionpl.flighttimes.FlightTimesService.getFlightsForDay(com.classactionpl.flighttimes.FlightTimesService$QueryType,java.lang.String,java.lang.String,java.lang.String,int,int,int,java.util.TimeZone)
which already has a body so ignoring parameter: 1 so ignoring method
[tTimeTables])]] Polling Thread] InMemoryFlightTimesService     INFO  New
set of time tables detected
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
receive with timeout: 1000 expired at batch index:0
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
Finished batch size: 100 timeout: 1000 so sending set: []
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
receive with timeout: 1000 expired at batch index:0
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
Finished batch size: 100 timeout: 1000 so sending set: []
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
receive with timeout: 1000 expired at batch index:0
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
Finished batch size: 100 timeout: 1000 so sending set: []


The INFO above shows that the exchange reaches my bean i.e. the route works.
I just don't understand why there's a polling thread running given the
complete config:


	from(
	
"file://target/classes/timetables?noop=true&consumer.delay=60000&consumer.recursive=true")
		.aggregator(new CollectAllAggregationStrategy()).constant(true)
		.process(new TimeTableToTimeTableObject()).to(
			"bean:inMemoryFlightTimesService?method=setTimeTables");


In case it helps, the bean is defined with singleton scope using Spring.

Thank you for shedding light on the above.

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Unexpected-batch-processor-polling-thread-tp19877186s22882p19877186.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Unexpected batch processor polling thread

Posted by huntc <hu...@mac.com>.

Claus Ibsen wrote:
> 
> It's the aggregator that has a 1 sec timeout (aggregator and resequencer
> uses the BatchProcesser under the covers).
> 

OK, I understand that now. Thanks.

Is there a means by which the aggregator can stop polling once it has timed
out, and then start up again only when the endpoint it is associated with
has something to provide to it?

It seems wasteful to have an aggregator polling for activity when I know
that the file endpoint is dormant most of the time.

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Unexpected-batch-processor-polling-thread-tp19877186s22882p19890133.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Unexpected batch processor polling thread

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

It's the aggregator that has a 1 sec timeout (aggregator and resequencer uses the BatchProcesser under the covers).

BTW: I think it should use TRACE logging instead to avoid the logs being spammed (such as the file consumer does logging at TRACE level)


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: huntc [mailto:huntc@mac.com] 
Sent: 8. oktober 2008 13:51
To: camel-user@activemq.apache.org
Subject: Unexpected batch processor polling thread


Hi there,

I have debug logging enabled for Camel and notice that there's a polling
thread executing every second. What did I do to cause this polling thread to
exist?

The log shows the following:


[tTimeTables])]] Polling Thread] BeanInfo                       DEBUG No
expression available for method: public java.util.Collection
com.classactionpl.flighttimes.InMemoryFlightTimesService.getFlightsForDay(com.classactionpl.flighttimes.FlightTimesService$QueryType,java.lang.String,java.lang.String,java.lang.String,int,int,int,java.util.TimeZone)
which already has a body so ignoring parameter: 1 so ignoring method
[tTimeTables])]] Polling Thread] BeanInfo                       DEBUG No
expression available for method: public abstract java.util.Collection
com.classactionpl.flighttimes.FlightTimesService.getFlightsForDay(com.classactionpl.flighttimes.FlightTimesService$QueryType,java.lang.String,java.lang.String,java.lang.String,int,int,int,java.util.TimeZone)
which already has a body so ignoring parameter: 1 so ignoring method
[tTimeTables])]] Polling Thread] InMemoryFlightTimesService     INFO  New
set of time tables detected
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
receive with timeout: 1000 expired at batch index:0
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
Finished batch size: 100 timeout: 1000 so sending set: []
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
receive with timeout: 1000 expired at batch index:0
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
Finished batch size: 100 timeout: 1000 so sending set: []
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
receive with timeout: 1000 expired at batch index:0
[tTimeTables])]] Polling Thread] BatchProcessor                 DEBUG
Finished batch size: 100 timeout: 1000 so sending set: []


The INFO above shows that the exchange reaches my bean i.e. the route works.
I just don't understand why there's a polling thread running given the
complete config:


	from(
	
"file://target/classes/timetables?noop=true&consumer.delay=60000&consumer.recursive=true")
		.aggregator(new CollectAllAggregationStrategy()).constant(true)
		.process(new TimeTableToTimeTableObject()).to(
			"bean:inMemoryFlightTimesService?method=setTimeTables");


In case it helps, the bean is defined with singleton scope using Spring.

Thank you for shedding light on the above.

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Unexpected-batch-processor-polling-thread-tp19877186s22882p19877186.html
Sent from the Camel - Users mailing list archive at Nabble.com.