apache-camel

How to define custom namespace and tag alias using camel-xstream

丶灬走出姿态 提交于 2019-12-11 14:31:47
问题 I'm trying to transform the pipe delimited string to xml, which is working fine. But, I'm not getting the actual output which I have shown below. In my output the parent tag is generating along with the package name, also its not generating the namespace which I want. Can you anyone help me how to transform the flat file to the exact output which I'm expecting. CamelConfig.java @Component public class CamelConfig extends RouteBuilder { @Override public void configure() throws Exception { try

Apache Camel: GroupedExchangeAggregationStrategy groups DefaultExchange instead of message body

守給你的承諾、 提交于 2019-12-11 14:25:42
问题 In continuation to the other thread, Apache Camel : File to BeanIO and merge beanIO objects based on id Trying to group the EmployeeDetails using GroupedExchangeAggregationStrategy as below from("seda:aggregate").aggregate(simple("${body.id}"), new MergeAggregationStrategy()).completionSize(3).log("Details - ${header.details}").to("seda:formList"); from("seda:formList").aggregate(new GroupedExchangeAggregationStrategy()).constant(true).completionTimeout(10) .process

OnException maximumRedeliveries ignored

孤街浪徒 提交于 2019-12-11 14:24:10
问题 In the following route, the maximumRedeliveries clausule from redeliveryPolicy is ignored when we get an exception. We get: Failed delivery for (MessageId: ID-UW205584-58231-1527668174534-39-248 on ExchangeId: ID-UW205584-58231-1527668174534-39-24). On delivery attempt: 0 Failed delivery for (MessageId: ID-UW205584-58231-1527668174534-39-248 on ExchangeId: ID-UW205584-58231-1527668174534-39-24). On delivery attempt: 1 And then it remains in a infinity loop repeating the last retry. Any idea?

Not able to deploy a Spring Boot application(non-web) war file on weblogic 12c

*爱你&永不变心* 提交于 2019-12-11 14:23:39
问题 My application is not a web application and I have to deploy the spring boot camel application to WebLogic 12 server. I am getting this error while i deploy my war file to weblogic I am using mvn clean compile package command to build the war file java.io.FileNotFoundException: Could not open ServletContext resource [/CamelContext.xml] Message icon - Error Could not open ServletContext resource [/CamelContext.xml] My directory structure My pom.xml <project xmlns="http://maven.apache.org/POM/4

spring boot + mongodb + camel route connection issue

别说谁变了你拦得住时间么 提交于 2019-12-11 14:08:16
问题 I am new to camel route, trying to create a route which will read the content of a file and insert in mongodb, there is some wrong with it, seems like connection endpoint is not correct. Route Class @Component public class EmailResponseRoute extends RouteBuilder { @Override public void configure() throws Exception { from("file:C:/EmailResponseAutomation/response/") .to("mongodb://127.0.0.1:27017?database=email_response&collection=emailResponse&operation=save"); } } Log Error org.apache.camel

return back from current route in Apache Camel and continue routing

北城以北 提交于 2019-12-11 13:44:19
问题 Say we have 2 routes A and B . A route at some point calls route B . I'd like on certain condition in B route return back to A and continue A routing only, so stop() is unsuitable in my case. I'd like to keep my routes as is without serious refactoring 回答1: You can implement this using wiretap. In that case your logic must be changed: Route B splitted to B-common and B-cont where B-cont contains logic that must be processed after returning result to A Logic must be changed from "on certain

Apache camel returns multiple exceptions during a route

微笑、不失礼 提交于 2019-12-11 13:42:53
问题 The code: from("file://files") .split() .tokenize("\n") .split() .method(SplitToken.class, "hashTokens") .process(new Processor() { public void process(Exchange exchange) throws Exception { Set<Map.Entry<String, Integer>> oldSet = (Set<Map.Entry<String, Integer>>) exchange.getIn().getBody(Set.class); StringBuilder fin = new StringBuilder(); for (Map.Entry<String, Integer> entry : oldSet) { fin.append(entry.getValue() + " " + entry.getKey() + "\n"); } exchange.getIn().setBody(fin.toString());

Camel-Jersey Integration

余生颓废 提交于 2019-12-11 13:38:49
问题 I have a requirement to use Jersey 2 as the Rest interface. I need to adapt this to an existing system which has used CXF to pass in SOAP requests. I know I should use CXF-RS but... it's not what the client wants. I am auto-generating a WADL from a XML model and using that to autogenerate the resource classes (using CXF, but behind the scenes so to speak), so I really don't want to call a producer template from within the resource class. So, I have thought that I could wrap the REST resource

Apache-Camel : OnCompletion and OnException query

一笑奈何 提交于 2019-12-11 13:22:20
问题 In my project I want to apply separate OnCompletion and OnException processor on each newly created route. Suppose I have to create 3 routes. For each route I am preparing a separate RouteBuilder class and doing configuration like below - onException(Throwable.class).handled(true).process(new ExceptionHandlingProcessor(RouteId)).maximumRedeliveries(2) .redeliveryDelay(1000).retriesExhaustedLogLevel(LoggingLevel.ERROR) .retryAttemptedLogLevel(LoggingLevel.WARN); onCompletion().process(new

How to integrate Spring Boot, Camel and Mybatis

青春壹個敷衍的年華 提交于 2019-12-11 13:08:20
问题 Need to Integrate Camel and MyBatis with application using SpringBoot. SpringBoot provides out-of-box support for Camel and MyBatis. Also provides Camel and MyBatis SpringBoot starters. However, when i try to integrate Spring Boot application with Camel and MyBatis, it fails. I am using Java DSL based Camel Route. Also using Mybatis Spring boot dependencies. Annotate mappers, added database properties in the application.properties file. What I was expecting to happen: 1) SpringBoot setup