Created
April 23, 2021 09:52
-
-
Save lburgazzoli/0f4681ffe25cb7cdf8e4a4079902753b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///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