Tuesday, January 1, 2013

Camel - Timer 3

in addition to timer options , there is properties that timer component add to the generated exchange.
Timer Component add 5 properties in exchange properties and 1 header in the IN message.

exchange properties :

  • Exchange.TIMER_NAME ( property.CamelTimerName ) : using the following line will print the timer name :
                       from("timer://Demo2Timer?period=1000&repeatCount=1").setBody().simple("time now     is ${property.CamelTimerName}").to("stream:out");
           it will print : Demo2Timer
  • Exchange.TIMER_TIME ( property.CamelTimerTime) : this property have the value of time option if it is used in timer URI 
  • Exchange.TIMER_PERIOD ( property.CamelTimerPeriod ) : this property have the value of period option if used in timer URI
  • Exchange.TIMER_FIRED_TIME ( property.CamelTimerFiredTime ) :  this will hold date object contains the date when the timer fired
  • Exchange.TIMER_COUNTER ( property.CamelTimerCounter ) : this will print the counter of the timer starting from 1 

IN message Header:
  • Exchange.TIMER_FIRED_TIME ( header.CamelTimerFiredTime ) :  this will hold date object contains the date when the timer fired

No comments:

Post a Comment