Skip to content

Instantly share code, notes, and snippets.

@lburgazzoli
Created April 23, 2021 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lburgazzoli/0f4681ffe25cb7cdf8e4a4079902753b to your computer and use it in GitHub Desktop.
Save lburgazzoli/0f4681ffe25cb7cdf8e4a4079902753b to your computer and use it in GitHub Desktop.
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.slf4j:slf4j-simple:1.7.30
//DEPS org.apache.camel:camel-main:3.9.0
//DEPS org.apache.camel:camel-direct:3.9.0
//DEPS org.apache.camel:camel-log:3.9.0
//DEPS org.apache.camel:camel-timer:3.9.0
//DEPS org.apache.camel:camel-bean:3.9.0
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class boom {
private static final Logger LOG = LoggerFactory.getLogger(boom.class);
public static void main(String... args) throws Exception {
var main = new Main();
main.configure().addRoutesBuilder(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("timer:tick")
.transform().simple("${bean:java.lang.System?method=currentTimeMillis()}")
.to("log:info");
}
});
main.run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment