tree: 1de0ff7d88344107c50246efdb9e0ca00db166fa [path history] [tgz]
  1. hello.xml
  2. README.md
  3. routes.kts
  4. routes.yaml
  5. Sample.java
  6. simple.groovy
  7. simple.js
generic-examples/languages/README.md

Supported languages for writing Camel K integrations

Contains useful examples on how to develop a Camel K integration in Java, JavaScript, Groovy, XML, Kotlin and YAML.

You can find more information about Apache Camel and Apache Camel K on the official Camel website.

Before you begin

Read the general instructions in the root README.md file for setting up your environment and the Kubernetes cluster before looking at this example.

Make sure you've read the installation instructions for your specific cluster before starting the example.

Understanding the examples

  • routes.kts: defines a route that logs a message every second
  • routes.yaml: defines a route that every 5 secs, transforms the message content to uppercase and logs it.
  • simple.js: logs message periodically, the multiline query parameter is set to true, thus each information is output on a newline
  • hello.xml: defines a route that logs a message to a logger very 3 seconds.
  • simple.groovy: logs a message every second, the showAll query parameter is set to false, thus only a limited information is shown.
  • Sample.java: defines a route that logs a message periodically.

Running the Examples

To simply run an integration, execute kamel run [file to run]. For example:

kamel run routes.yaml