Skip to content

Instantly share code, notes, and snippets.

@sharpedavid
sharpedavid / CamelTestExample.java
Last active Jul 24, 2020
Self-encapsulated Camel test. Requires mvn camel-test and camel-core-engine.
View CamelTestExample.java
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 {
@Override
protected RoutesBuilder createRouteBuilder() {
return new RouteBuilder() {
View .bashrc
alias todo='grep -r "TODO" * --include=*.{xml,java,txt} --exclude-dir=target'
View Enrich.java
from("direct:mainroute")
.routeId("mainroute")
// 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
sharpedavid / MyRouteBuilder.java
Created Oct 4, 2018
A Camel Java8 DSL Router
View MyRouteBuilder.java
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
*/
View keybase.md

Keybase proof

I hereby claim:

  • I am sharpedavid on github.
  • I am sharpe (https://keybase.io/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.