@Override public void configure() throws Exception { from("timer://foo?delay=0&repeatCount=1") .setBody(new HeaderExpression(Exchange.TIMER_COUNTER)) .transform(body().prepend("Hello ")) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { System.out.println("Writing " + exchange + " to " + System.getProperty("jboss.server.data.dir")); } }) .to("file://{{jboss.server.data.dir}}/" + RouteBuilderA.class.getName() + "?fileName=fileA&doneFileName=fileA.done"); }
/** * @return processor which sets the properties of this configuration as exchange properties. */ public Processor asSetPropertiesToExchangeProcessor() { return new Processor() { private final HeaderExpression headerFileName = new HeaderExpression(Exchange.FILE_NAME); @Override public void process(Exchange exchange) throws Exception { // NOTE: use the Header FILE_NAME instead of our context property // because that's dynamic and also the filename is not set when creating the context from CamelContext exchange.setProperty(Exchange.FILE_NAME, headerFileName.evaluate(exchange, String.class)); // exchange.setProperty(CONTEXT_EDIMessageDatePattern, EDIMessageDatePattern); exchange.setProperty(CONTEXT_AD_Client_Value, AD_Client_Value); exchange.setProperty(CONTEXT_AD_Org_ID, AD_Org_ID); exchange.setProperty(CONTEXT_ADInputDataDestination_InternalName, ADInputDataDestination_InternalName); exchange.setProperty(CONTEXT_ADInputDataSourceID, ADInputDataSourceID); exchange.setProperty(CONTEXT_ADUserEnteredByID, ADUserEnteredByID); exchange.setProperty(CONTEXT_DELIVERY_RULE, DeliveryRule); exchange.setProperty(CONTEXT_DELIVERY_VIA_RULE, DeliveryViaRule); // exchange.setProperty(CONTEXT_CurrencyISOCode, currencyISOCode); } }; }
public RoutingSlipDefinition(String headerName, String uriDelimiter) { super(new HeaderExpression(headerName)); setUriDelimiter(uriDelimiter); }
/** * An expression of an inbound message header of the given name */ public T header(String name) { return expression(new HeaderExpression(name)); }
/** * Returns a value builder for the given header */ public ValueBuilder header(String name) { Expression exp = new HeaderExpression(name); return new ValueBuilder(exp); }
/** * Returns a predicate and value builder for headers on an exchange */ public static ValueBuilder header(String name) { Expression exp = new HeaderExpression(name); return new ValueBuilder(exp); }