public void configure() { logger.info("configure", null, "Configuring Admin Channel on Endpoint:" + endpoint); onException(Exception.class).handled(true).process(new ErrorProcessor()); from(endpoint).routeId("AdminRoute").unmarshal().xstream() .process(new AdminEventProcessor(delegate)); } });
.log(LoggingLevel.ERROR, "Error processing record ${exchangeProperty.CamelSplitIndex}++ !") .handled(true) .process(new LineSplitFailureHandler()) .onException(Exception.class) .log(LoggingLevel.ERROR, "Failed to process file.")
.log(LoggingLevel.ERROR, "Error processing record ${exchangeProperty.CamelSplitIndex}++ !") .handled(true) .process(new LineSplitFailureHandler()) .onException(Exception.class) .log(LoggingLevel.ERROR, "Failed to process file.")
@Override public void configure() throws Exception { restConfiguration() .component("servlet") .enableCORS(true) .contextPath("/") .bindingMode(RestBindingMode.auto); rest("/").get().produces("text/plain") .route().routeId("root") .to("http4:recommendation:8080/?httpClient.connectTimeout=1000&bridgeEndpoint=true©Headers=true&connectionClose=true") .routeId("recommendation") .onException(HttpOperationFailedException.class) .handled(true) .process(this::handleHttpFailure) .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(503)) .end() .onException(Exception.class) .handled(true) .transform(simpleF(RESPONSE_STRING_FORMAT, exceptionMessage()) ) .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(503)) .end() .transform(simpleF(RESPONSE_STRING_FORMAT, "${body}")) .endRest(); }
@Override public void configure() throws Exception { restConfiguration() .component("servlet") .enableCORS(true) .contextPath("/") .bindingMode(RestBindingMode.auto); rest("/").get().consumes(MediaType.TEXT_PLAIN_VALUE) .route().routeId("root") .pipeline() .bean("CustomerCamelRoute", "addTracer") .to("http4:preference:8080/?httpClient.connectTimeout=1000&bridgeEndpoint=true©Headers=true&connectionClose=true") .end() .convertBodyTo(String.class) .onException(HttpOperationFailedException.class) .handled(true) .process(this::handleHttpFailure) .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(503)) .end() .onException(Exception.class) .log(exceptionMessage().toString()) .handled(true) .transform(simpleF(RESPONSE_STRING_FORMAT, exceptionMessage())) .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(503)) .end() .transform(simpleF(RESPONSE_STRING_FORMAT, "${body}")) .endRest(); }