Jactl Meets Apache Camel: Benchmarking camel-jactl
camel-jactl is a new Apache Camel
language module that lets you use Jactl as the scripting language inside Camel for things such as
filter predicates, content-based routing rules, and message transformations.
It registers itself through Camel's Language SPI under the name jactl.
import static io.jactl.camel.JactlLanguage.jactl;
from("direct:orders")
.filter(jactl("body.amount > 100 && body.status == 'NEW'"))
.to("direct:big-orders");
// Or via the Language SPI:
Language jactl = camelContext.resolveLanguage("jactl");
Predicate p = jactl.createPredicate("body.age > 20");
Expression e = jactl.createExpression("'Hello ' + body.name");
This post uses JMH benchmarks to compare the performance of Jactl against Camel's built-in
Simple language and against Groovy (via camel-groovy) in the places where scripting languages
typically appear in Camel applications, from single predicate evaluations up to a complete
order-processing route, with a plain-Java route as the no-scripting baseline.
