@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(DataModel.class); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, DataModel.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, Order.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(BindySimpleIgnoreTrailingCharsTest.Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, BindySimpleIgnoreTrailingCharsTest.Order.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_UNMARSHALL) .unmarshal(bindy) .to(URI_MOCK_UNMARSHALL_RESULT); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); } }; return routeBuilder; }
public void configure() { Tracer tracer = new Tracer(); tracer.setLogLevel(LoggingLevel.ERROR); tracer.setLogName("org.apache.camel.bindy"); getContext().addInterceptStrategy(tracer); // default should errors go to mock:error errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0)); onException(Exception.class).maximumRedeliveries(0).handled(true); BindyDataFormat bindy = new BindyDataFormat(); bindy.setLocale("en"); bindy.setClassType(Order.class); bindy.setType(BindyType.Fixed); from(URI_DIRECT_START) .marshal(bindy) .to(URI_MOCK_RESULT); }
@Bean @Override public RouteBuilder route() { return new RouteBuilder() { public void configure() { Tracer tracer = new Tracer(); tracer.setLogLevel(LoggingLevel.ERROR); tracer.setLogName("org.apache.camel.bindy"); getContext().addInterceptStrategy(tracer); // default should errors go to mock:error errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0)); onException(Exception.class).maximumRedeliveries(0).handled(true); BindyDataFormat bindy = new BindyDataFormat(); bindy.setLocale("en"); bindy.setClassType(Order.class); bindy.setType(BindyType.Fixed); from(URI_DIRECT_START) .marshal(bindy) .to(URI_MOCK_RESULT); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(BindySimpleFixedLengthOrdinalPosTest.Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, BindySimpleFixedLengthOrdinalPosTest.Order.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(BindySimpleSkipFieldsTest.Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, BindySimpleSkipFieldsTest.Order.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(BindyFixedLengthDelimitedFieldTest.Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, BindyFixedLengthDelimitedFieldTest.Order.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setLocale("en"); bindy.setClassType(BindyFixedLengthDynamicFieldTest.Order.class); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, BindyFixedLengthDynamicFieldTest.Order.class) .to(URI_MOCK_UNMARSHALL_RESULT); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setType(BindyType.Csv); bindy.setClassType(NumberModel.class); bindy.setLocale("en"); from(URI_DIRECT_START) .unmarshal(bindy) .to(URI_MOCK_RESULT); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Csv); from("direct:in") .marshal(bindy) .to("mock:in"); from("direct:out") .unmarshal().bindy(BindyType.Csv, Order.class) .to("mock:out"); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class); bindy.setLocale("en"); bindy.setType(BindyType.Csv); from("direct:in") .marshal(bindy) .to("mock:in"); from("direct:out") .unmarshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class) .to("mock:out"); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { Class<?> type = org.apache.camel.dataformat.bindy.model.car.Car.class; BindyCsvDataFormat dataFormat = new BindyCsvDataFormat(); dataFormat.setClassType(type); dataFormat.setLocale("en"); from("direct:out") .unmarshal().bindy(BindyType.Csv, type) .to("mock:out"); from("direct:in") .marshal(dataFormat) .to("mock:in"); } }; }
@Override public void configure() { errorHandler(deadLetterChannel(deadQueue)); from(inQueue).routeId("yahoo") .process(jsonConsumerProcessor) .convertBodyTo(String.class) .setHeader(Exchange.HTTP_METHOD, constant("GET")) .setHeader(Exchange.HTTP_URI, body(String.class)) .to("http://dummy") .to("direct:splitter"); from("direct:splitter").routeId("splitter") .unmarshal().bindy(BindyType.Csv, YahooCSV.class) .split(body()).streaming().executorService(executorService) .to("direct:reply"); from("direct:reply").routeId("reply") .convertBodyTo(InstrumentPriceCommandMessage.class) .setHeader(JmsConstants.JMS_DESTINATION, header(ASYNC_REPLY_TO)) .process(jsonProducerProcessor) .to("jms:queue:asyncreplydummy"); getContext().setTracing(yahooTrace); }
public void configure() { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(DataModel.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, DataModel.class) .to(URI_MOCK_UNMARSHALL_RESULT); }
public void configure() { BindyDataFormat bindy = new BindyDataFormat(); bindy.setClassType(Record.class); bindy.setLocale("en"); bindy.setType(BindyType.Fixed); from(URI_DIRECT_MARSHALL) .marshal(bindy) .to(URI_MOCK_MARSHALL_RESULT); from(URI_DIRECT_UNMARSHALL) .unmarshal().bindy(BindyType.Fixed, Record.class) .to(URI_MOCK_UNMARSHALL_RESULT); }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start") .marshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.csv2.WeatherModel.class) .to("mock:result"); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start") .marshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.csv2.WeatherModel.class) .to("direct:middle"); from("direct:middle") .unmarshal(new BindyCsvDataFormat(org.apache.camel.dataformat.bindy.csv2.WeatherModel.class)) .to("mock:result"); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start") .unmarshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.csv2.WeatherModel.class) .to("mock:result"); } }; }
public void configure() { BindyDataFormat bindy = new BindyDataFormat(); bindy.setLocale("en"); bindy.setClassType(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class); bindy.setType(BindyType.Csv); from("direct:start"). marshal(bindy) .to("mock:result"); }
private RouteBuilder createRoute() { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:fromCsv").unmarshal().bindy(BindyType.Csv, MyCsvRecord.class) .setProperty("addressLine1", simple("${in.body.addressLine1}")) .setProperty("addressLine2", simple("${in.body.addressLine2}")).log("${in.body}") .to("mock:result"); } }; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:unmarshal") .unmarshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.model.simple.pipeline.MyData.class) .to("mock:result"); from("direct:marshal") .marshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.model.simple.pipeline.MyData.class) .to("mock:result"); } }; }
public RouteBuilder createRoute() { return new RouteBuilder() { public void configure() throws Exception { from("direct:toObject") .unmarshal().bindy(BindyType.Csv, camelinaction.bindy.PurchaseOrder.class) .to("mock:result"); } }; }
public RouteBuilder createRoute() { return new RouteBuilder() { public void configure() throws Exception { from("direct:toCsv") .marshal().bindy(BindyType.Csv, camelinaction.bindy.PurchaseOrder.class) .to("mock:result"); } }; }
public RouteBuilder createRoute() { return new RouteBuilder() { public void configure() throws Exception { from("direct:toObject") .unmarshal().bindy(BindyType.Csv, "camelinaction.bindy") .to("mock:result"); } }; }
public RouteBuilder createRoute() { return new RouteBuilder() { public void configure() throws Exception { from("direct:toCsv") .marshal().bindy(BindyType.Csv, "camelinaction.bindy") .to("mock:result"); } }; }
public BindyType getType() { return type; }
public void setType(BindyType type) { this.type = type; }
public void configure() { from("direct:start").marshal() .bindy(BindyType.KeyValue, org.apache.camel.dataformat.bindy.model.fix.simple.Order.class) .to("mock:result"); }
public void configure() { from(URI_FILE_FIX).unmarshal() .bindy(BindyType.KeyValue, Order.class) .to(URI_MOCK_RESULT); }