StringWriter buffer = new StringWriter();
String logTag = getClass().getName();
Map variableMap = ExchangeHelper.createVariableMap(exchange);
Context velocityContext = new VelocityContext(variableMap);
VelocityEngine engine = getVelocityEngine();
engine.evaluate(velocityContext, buffer, logTag, reader);
// now lets output the results to the exchange
Message out = exchange.getOut(true);
out.setBody(buffer.toString());
out.setHeader("org.apache.camel.velocity.resource", getResource());