Groovy

JVM since1.0.0 Native since3.2.0

Evaluate a Groovy script

What’s inside

Please refer to the above link for usage and configuration details.

Maven coordinates

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-groovy</artifactId>
</dependency>

Check the User guide for more information about writing Camel Quarkus applications.

Camel Quarkus limitations

Native mode limitations

Compilation of Groovy expressions is made with static compilation enabled. Which means that the types used in your expressions must be known at compile time. Please refer to the Groovy documentation for more details.

This primarily impacts the customization of the Groovy Shell and the handling of exchange information. In native mode, customizing the Groovy Shell and accessing the following exchange variables will not function as expected.

  • attachment

  • exchangeProperty

  • exchangeProperties

  • header

  • log

  • variable

  • variables

If you use property placeholders within your expressions like.

from("direct:start")
    .transform().groovy("println '{{greeting.message}}'");

greeting.message will be evaluated once at build time and its value will be permanently stored in the native image. It is not possible to override the value of the property at runtime. Attempting to do so will result in an exception being thrown.