Skip to content

Instantly share code, notes, and snippets.

@hguerrero
Created July 3, 2023 16:58
Show Gist options
  • Save hguerrero/7757de49e4eb3f8c96e3e3756ddf02f9 to your computer and use it in GitHub Desktop.
Save hguerrero/7757de49e4eb3f8c96e3e3756ddf02f9 to your computer and use it in GitHub Desktop.
Camel JBang JS DSL + Java Classes
public class Cat {
private final String name;
public Cat(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String say() {
return name + " mjaus";
}
}
// camel-k: language=js
// Write your routes here, for example:
from("timer:cat2dog?period={{time:5000}}").routeId("cat2dog")
.setBody(e => new Cat("Snoopy"))
.log("${body.say()}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment