Open gautric opened 9 years ago
Actually this can be implemented using Camel DSL filter:
from("i2c://1/0x12?label=Temp").filter().simple("${body} > 25").to("amqp:queue:alerting.acme.temp")
And you can use any expression language you want.
What do you think? Is there any additional value in adding filtering logic on the component level?
@hekonsek yep you are right,
but I am thinking about CPU consumption too ;-) we deploy camel route over small, tiny and low cost CPU.
Hmmm, but you have to read the value anyway to determine if it is too high or not. If so, then doing it on the Camel level won't consume much more CPU. But maybe I'm wrong :) .
we could implement for some device a threshold feature.
for example if TEMP >= 25 ºC, temp camel could start send alert to the external process
from("i2c://1/0x12?label=Temp&threshold=[>25]").to("amqp:queue:alerting.acme.temp")