@Override protected void doConfigure() throws Exception { from(AsynchConstants.URI_EX_TRANSLATION) .routeId(ROUTE_ID_EX_TRANSLATION) .errorHandler(noErrorHandler()) .process(ExceptionTranslator.getInstance()); } }
@Override public void configure() throws Exception { setHttpClientConfigurerName(); String extraOptionsString = buildExtraOptionString(); from("liferay:" + messageBusDestination) .errorHandler(deadLetterChannel("direct:error_" + messageBusDestination)) .setProperty("correlationId", header("responseId")) //if the body of the message is not null Camel will do a POST request .inOut(httpDestination + extraOptionsString) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { String result = extractResponseBody(exchange); exchange.getOut().setBody(result); } }) .setHeader("responseId", property("correlationId")) .to("liferay:" + DestinationNames.MESSAGE_BUS_DEFAULT_RESPONSE); errorHandler(); }
@Override public void configure() throws Exception { from("direct:start") .errorHandler(deadLetterChannel("mock:error") .maximumRedeliveries(3) .redeliveryDelay(1000) .backOffMultiplier(2) .useOriginalMessage() .useExponentialBackOff()) .transform(body().append(" Modified data!")) .to("mock:result"); } }
@Override public void configure() throws Exception { from("direct:input") .toF("mhd-iti67:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("mhd-iti67:translation?audit=true") .errorHandler(noErrorHandler()) .transform(new Iti67Responder()); }
@Override public void configure() throws Exception { from("direct:input") .toF("mhd-iti66:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("mhd-iti66:translation?audit=true") .errorHandler(noErrorHandler()) .transform(new Iti66Responder()); }
@Override public void configure() throws Exception { from("direct:input") .toF("mhd-iti66:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("mhd-iti66:translation?audit=true") .errorHandler(noErrorHandler()) .transform(new Iti66Responder()); }
@Override public void configure() throws Exception { from("direct:input") .toF("mhd-iti67:localhost:%d?fhirContext=#fhirContext", FhirTestContainer.DEMO_APP_PORT); from("mhd-iti67:translation?audit=true&fhirContext=#fhirContext") .errorHandler(noErrorHandler()) .transform(new Iti67Responder()); }
@Override public void configure() throws Exception { from("liferay:" + messageBusDestination) .errorHandler(deadLetterChannel("direct:error_" + messageBusDestination)) .setProperty("correlationId", header("responseId")) .bean(beanType, methodCall) .setHeader("responseId", property("correlationId")) .to("liferay:" + DestinationNames.MESSAGE_BUS_DEFAULT_RESPONSE); from("direct:error_" + messageBusDestination) .process(new ErrorProcessor()) .setHeader("responseId", property("correlationId")) .to("liferay:" + DestinationNames.MESSAGE_BUS_DEFAULT_RESPONSE); } }
@Override public void configure() throws Exception { from("liferay:" + messageBusDestination) .errorHandler(deadLetterChannel("direct:error_" + messageBusDestination)) .setProperty("correlationId", header("responseId")) .beanRef(beanRef, methodCall) .setHeader("responseId", property("correlationId")) .to("liferay:" + DestinationNames.MESSAGE_BUS_DEFAULT_RESPONSE); from("direct:error_" + messageBusDestination) .process(new ErrorProcessor()) .setHeader("responseId", property("correlationId")) .to("liferay:" + DestinationNames.MESSAGE_BUS_DEFAULT_RESPONSE); } }
@Override public void configure() throws Exception { from("direct:input") .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET)) .toF("http4:localhost:%d", StandardTestContainer.DEMO_APP_PORT); from("mhd-iti68:download?audit=true") .errorHandler(noErrorHandler()) .transform(new Iti68Responder()); }
@Override public void configure() throws Exception { from("liferay:" + messageBusDestination) .errorHandler(deadLetterChannel("direct:error_" + messageBusDestination)) .setHeader(Exchange.HTTP_METHOD, simple(restMethod)) .setHeader(Exchange.ACCEPT_CONTENT_TYPE, simple(restContentType)) .setProperty("correlationId", header("responseId")) .inOut("cxfrs://" + restDestination) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { String result = extractResponseBody(exchange); exchange.getOut().setBody(result); } }) .setHeader("responseId", property("correlationId")) .to("liferay:" + DestinationNames.MESSAGE_BUS_DEFAULT_RESPONSE); errorHandler(); }
@Override public void configure() { from("direct:input") .toF("mhd-iti65:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("mhd-iti65:stub?audit=true&fhirContext=#fhirContext") .errorHandler(noErrorHandler()) .setHeader(ValidatorAdapter.NEED_VALIDATION_HEADER_NAME, constant(true)) .setHeader(VALIDATION_MODE, constant(SCHEMA | SCHEMATRON )) // | MODEL)) .process(itiRequestValidator()) .transform(new Responder()); // Start up a second transaction route, sharing the same resource provider // and the same FHIR context if (startSecondRoute) { from("batch:batch?audit=false&fhirContext=#fhirContext") .errorHandler(noErrorHandler()) .throwException(new UnprocessableEntityException("This sucks")); } }
@Override public void configure() throws Exception { from("direct:input") .toF("mhd-iti65:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("mhd-iti65:stub?audit=true") .errorHandler(noErrorHandler()) .setHeader(VALIDATION_MODE, constant(SCHEMA | MODEL)) .process(itiRequestValidator()) .transform(new Responder()); }
@Override public void configure() throws Exception { from("direct:input") .toF("pdqm-iti78:localhost:%d?sslContextParameters=#myContext", FhirTestContainer.DEMO_APP_PORT); from("pdqm-iti78:translation?audit=true") // Translate into ITI-9 .errorHandler(noErrorHandler()) .process(translateFhir(requestTranslator)) .process(itiValidator()) // Create some static response .transform(new Iti21Responder(responseCase)) // Translate back into FHIR .process(itiValidator()) .process(translateToFhir(responseTranslator, Message.class)); }
@Override public void configure() throws Exception { from("direct:input") .toF("pdqm-iti78:localhost:%d?sslContextParameters=#myContext", FhirTestContainer.DEMO_APP_PORT); from("pdqm-iti78:translation?audit=true") // Translate into ITI-9 .errorHandler(noErrorHandler()) .process(translateFhir(requestTranslator)) .process(itiValidator()) // Create some static response .transform(new Iti21Responder(responseCase)) // Translate back into FHIR .process(itiValidator()) .process(translateToFhir(responseTranslator, Message.class)); }
@Override public void configure() throws Exception { from("direct:input") .toF("pdqm-iti78:localhost:%d?fhirContext=#fhirContext", FhirTestContainer.DEMO_APP_PORT); from("pdqm-iti78:translation?audit=true&fhirContext=#fhirContext") // Translate into ITI-9 .errorHandler(noErrorHandler()) .process(translateFhir(requestTranslator)) .process(itiValidator()) // Create some static response .transform(new Iti21Responder(responseCase)) // Translate back into FHIR .process(itiValidator()) .process(translateToFhir(responseTranslator, Message.class)); }
@Override public void configure() throws Exception { from("direct:input") .toF("pdqm-iti78:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("pdqm-iti78:translation?audit=true") // Translate into ITI-9 .errorHandler(noErrorHandler()) .process(translateFhir(requestTranslator)) .process(itiValidator()) // Create some static response .transform(new Iti21Responder(responseCase)) // Translate back into FHIR .process(itiValidator()) .process(translateToFhir(responseTranslator, Message.class)); }
@Override public void configure() throws Exception { from("direct:input") .toF("pixm-iti83:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("pixm-iti83:translation?audit=true") // Translate into ITI-9 .errorHandler(noErrorHandler()) .process(translateFhir(requestTranslator)) .process(itiValidator()) // Create some static response .transform(new Iti9Responder(responseCase)) // Translate back into FHIR .process(itiValidator()) .process(translateToFhir(responseTranslator, Message.class)); }
@Override public void configure() throws Exception { from("direct:input") .toF("pixm-iti83:localhost:%d", FhirTestContainer.DEMO_APP_PORT); from("pixm-iti83:translation?audit=true") // Translate into ITI-9 .errorHandler(noErrorHandler()) .process(translateFhir(requestTranslator)) .process(itiValidator()) // Create some static response .transform(new Iti9Responder(responseCase)) // Translate back into FHIR .process(itiValidator()) .process(translateToFhir(responseTranslator, Message.class)); }
@Override public void configure() throws Exception { // global error handler errorHandler(noErrorHandler()); from("direct:input-1") .to("mock:inter") // inherits global error handler (step in pipeline) .process(failure) // inherits global error handler (step in pipeline) .to("mock:output"); // inherits global error handler (step in pipeline) from("direct:input-2") // defines local error handler (placed before every node in this route) .errorHandler(defaultErrorHandler().maximumRedeliveries(2)).to("mock:error") .onException(Exception.class).handled(false).end() .to("mock:inter") // no redeliveries here .to("direct:temp"); // the error handler of this node redelivers from("direct:temp") .to("mock:check") // inherits global error handler (step in pipeline) .process(failure) // inherits global error handler (step in pipeline) .to("mock:output"); // inherits global error handler (step in pipeline) }