@Override public void configure() throws Exception { logger.info("Configure Recurrent Route 'To Target'"); RouteDefinition rtDef; if (RouterConstants.CONFIG_TYPE_KAFKA.equals(configType)) { rtDef = from((KafkaEndpoint) getEndpointURI(RouterConstants.DIRECTION_TO, RouterConstants.DIRECT_IMPORT_DEPOSIT_BUFFER)); } else { rtDef = from((String) getEndpointURI(RouterConstants.DIRECTION_TO, RouterConstants.DIRECT_IMPORT_DEPOSIT_BUFFER)); } rtDef.choice() .when(header(RouterConstants.HEADER_FAILED_MESSAGE).isNull()) .unmarshal(jacksonDataFormat) .process(unomiStorageProcessor) .otherwise() .log(LoggingLevel.DEBUG, "Failed message, skip processing!") .end() .aggregate(constant(true), new ArrayListAggregationStrategy()) .completionPredicate(exchangeProperty("CamelSplitComplete").isEqualTo("true")) .eagerCheckCompletion() .process(importRouteCompletionProcessor) .to("log:org.apache.unomi.router?level=DEBUG"); }
@Override public void configure() throws Exception { //NOSONAR super.configure(); // initial route RouteDefinition route = appendSplitterRoutes( appendFilterRoutes( from(endpoints.getInputUri()) ) ); // main processing route addInterimProc(route .setHeader(PLUGIN_ID, constant(pluginId)) .log(DEBUG, format("===> INPUT FOR %s ${exchangeId} ${in.header.bodyClass}, correlationKey: ${in.header.correlationKey}", pluginId)) .process(getProcessor())) .choice() .when(body().isNull()) .log(DEBUG, pluginId + " output is NULL, skipping next routes") .stop() .otherwise() .log(DEBUG, format("===> ROUTE %s ===> %s", endpoints.getInputUri(), endpoints.getProducerUri())) .to(endpoints.getProducerUri()) .routeId(endpoints.getInputRouteId()); }
.when(body().isNull()) .log(DEBUG, pluginId + " output is NULL, skipping next routes") .stop()
.when(header(MSG_HEADER).isNull())