Hi I have following issuses while working with timer component.
1. How to set the time as a part of the URI, i have come across the
examples where periord and fixedrate are set as a part of the URI like the
following URI
from("timer://foo?fixedRate=true&period=60000").to("bean:myBean?method=someMethodName");
if i have to set the time , how will i set it as a part of the URI?
2. I have the camel route following
/////////////////////Camel route file starts //////////////////////////////
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.5.0.xsd">
<import resource="test.xml" />
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring"
id="camelroute">
<route id="null_1">
<description />
<from id="Timer_0"
uri="timer://myfirsttimer?period=10000&delay=0&fixedRate=true&daemon=true">
<description>Timer: The timer component is used
to generate message
exchanges when a timer fires</description>
</from>
<to id="Generic_0" uri="bean:myClass?method=invoke">
<description>Generic: Specifies a general
endpoint URL</description>
</to>
</route>
</camelContext>
</beans>
////////////////////Camel Route file ends
/////////////////////////////////////////////////////////////////////
I was expecting it will call the invoke method of bean named myClass every
10 seconds, but it is called
only once as indicated by the following console
////////////console starts ////////////
Listening for transport dt_socket at address: 8708
current Working directory is C:\EclipseWS\runtime-New_configuration\test
##### class com.fusesource.tools.eip.run.debugger.scaffolded.CamelLauncher
PARAMS => debug=false, run=true, debugPort=1835, eventPort=1836,
contextFileName=D:/Installs/IONA/Eclipse3.4.1/eclipse/runtime-New_configuration(1)/FuseOne/src/main/resources/META-INF/spring/wiretap-camel.xml
#####
##### debug=false, debugPort=1835, eventPort=1836,
contextFileName=file:/C:/EclipseWS/runtime-New_configuration/test/default-camel.xml
#####
log4j:WARN No appenders could be found for logger
(org.springframework.context.support.FileSystemXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
invoked
////////////console ends /////////////
//////////////////bean -myclass starts ///////////////
public class MyClass {
public void invoke() {
System.out.println("invoked");
}
}
//////////////////bean -myclass ends///////////////
So why is it the invoke method of the bean myClass called only once?
if somebody has the answers to above questions,please do revert back.
Regards,
Aman.
--
View this message in context:
http://www.nabble.com/Camel-Timer-Componenet-tp24068841p24068841.html
Sent from the Camel - Users mailing list archive at Nabble.com.