Skip to content

Instantly share code, notes, and snippets.

sharpedavid /
Last active Jul 24, 2020
Self-encapsulated Camel test. Requires mvn camel-test and camel-core-engine.
import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
public class CamelTestExample extends CamelTestSupport {
protected RoutesBuilder createRouteBuilder() {
return new RouteBuilder() {
View .bashrc
alias todo='grep -r "TODO" * --include=*.{xml,java,txt} --exclude-dir=target'
// pretend this is the message sent in
.transform(constant(new String("original message")))
// Prints "original message"
.log("mainroute. request = ${body}")
.enrich("direct:query_external", (Exchange oldExchange, Exchange newExchange) -> oldExchange)
// Prints "original message"
.log("mainroute. response = ${body}");
sharpedavid /
Created Oct 4, 2018
A Camel Java8 DSL Router
package com.cgi;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
* A Camel Java8 DSL Router

Keybase proof

I hereby claim:

  • I am sharpedavid on github.
  • I am sharpe ( on keybase.
  • I have a public key ASDQVjrJD6Mm5fVIMJWh4lls-NkNpWWXiwwmI-B_Jnfqvgo

To claim this, I am signing this object:

You can’t perform that action at this time.