/** * receives JMS message. * * @throws Exception * Persistence error */ @Override public void configure() throws Exception { from("properties:{{helloApp.inQueueJMS}}"/* "jms:queue:helloServiceQueueIn" */) .log(LoggingLevel.INFO, "received jms message: ${body}").unmarshal(this.helloObjectJSonFormat) .process(exchange -> HelloServiceJMS.this.persistHello((HelloEntity) exchange.getIn().getBody())); }
public void configure() { from("file:data/inbox?noop=true") .unmarshal() .json(JsonLibrary.Gson) .process(exchange -> { System.out.format(" %s%n", exchange.getIn().getBody()); }) .filter(body().convertToString().contains("uke")) .marshal() .json(JsonLibrary.Gson) .to("file:data/outbox"); } });
@Override public void configure() throws Exception { JacksonDataFormat jackson = new JacksonDataFormat(); String result_queue = "latexmlresults_"+UUID.randomUUID().toString(); from("activemq:queue:"+result_queue) .unmarshal(jackson) .bean(method(this, "compile_result")); from("direct:compileLaTeXML") .setHeader("uid", constant(uid)) .setHeader("JMSReplyTo", constant(result_queue)) .to("activemq:queue:latexml?preserveMessageQos=true"); }
@Override public void configure() throws Exception { JacksonDataFormat configFormat = new JacksonDataFormat(MHWWorkerConfig.class); from("file://"+lmhRoot+"?fileName=worker.cfg&delay=10000&noop=true") .unmarshal(configFormat) .bean(method(this, "setConfig")); from("direct:saveConfig") .marshal(configFormat) .to("file://"+lmhRoot+"?fileName=worker.cfg"); }
/** * Route for <strong>asyncHello</strong> operation - process delivery to external systems. * <p/> * Prerequisite: none */ private void createRouteForAsyncHelloRouteOut() { from(URI_ASYNC_HELLO_OUT) .routeId(ROUTE_ID_ASYNC_OUT) // xml -> AsyncHelloRequest .unmarshal(jaxb(AsyncHelloRequest.class)) .to("extcall:message:" + URI_PRINT_GREETING); from(URI_PRINT_GREETING) .bean(this, "printGreeting"); }
@Override public void configure() throws Exception { DataFormat annotation = parser.getFormat("annotation"); from("direct:sendAnnotationAlexInOut") .marshal(annotation) .inOut("alex:default") .unmarshal(annotation); from("direct:sendAnnotationAlex") .marshal(annotation) .to("alex:default"); }
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)); } });
@Override public void configure() throws Exception { logger.info("Configure Recurrent Route 'Export :: Data Producer'"); RouteDefinition rtDef; if (RouterConstants.CONFIG_TYPE_KAFKA.equals(configType)) { rtDef = from((KafkaEndpoint) getEndpointURI(RouterConstants.DIRECTION_TO, RouterConstants.DIRECT_EXPORT_DEPOSIT_BUFFER)); } else { rtDef = from((String) getEndpointURI(RouterConstants.DIRECTION_TO, RouterConstants.DIRECT_EXPORT_DEPOSIT_BUFFER)); } LineBuildProcessor processor = new LineBuildProcessor(profileExportService); rtDef.unmarshal(jacksonDataFormat) .process(processor) .aggregate(constant(true), new StringLinesAggregationStrategy()) .completionPredicate(exchangeProperty("CamelSplitSize").isEqualTo(exchangeProperty("CamelAggregatedSize"))) .eagerCheckCompletion() .process(exportRouteCompletionProcessor) .toD("${in.header.exportConfig.getProperty('destination')}"); }
@Override public void configure() throws Exception { DataFormat core = parser.getFormat("core"); from("sallyservlet:///") .to("freemarker:index.html"); from("sallyservlet:///docmanager") .bean(method(this, "prepareDocManagement")) .to("freemarker:docmanager.html"); from("activemq:queue:"+sallyRegisterQueue) .to("log:registermsg") .unmarshal(core) .bean(method(clientManager, "registerDocument")) .marshal(core); }
@Override public void configure() throws Exception { DataFormat format = new DataFormatAdapter(new TestConverter()); from("direct:external").unmarshal(format); from("direct:internal").marshal(format).convertBodyTo(String.class); }
.unmarshal().json(JsonLibrary.Jackson, Order.class) .choice() .when(header("CamelFileName").isEqualTo("simple.json")).process(new Process05())