spring-camel

Camel Rest to dB Query, returning incorrect response

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:31:22
问题 I am trying to receive a xml message from a rest call, then make a call to the db, map each row into an object and then return the complete marshalled object as the rest response. However my db query result is being returned as the rest response even before the last process has executed. Can you please advise if there is something wrong I am doing that is resulting in the dB query being returned? Please also advise if my solution is the correct approach, As the real db query will have about

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

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?

Camel saves full http request but I want only attached file

人走茶凉 提交于 2019-12-02 16:28:24
问题 I have the following code base: @Component public class DummyRoute extends RouteBuilder { @Override public void configure() throws Exception { rest("/upload").post().to("file://rest_files"); } @Bean public ServletRegistrationBean servletRegistrationBean() { SpringServerServlet serverServlet = new SpringServerServlet(); ServletRegistrationBean regBean = new ServletRegistrationBean( serverServlet, "/rest/*"); Map<String,String> params = new HashMap<>(); params.put("org.restlet.component",

Camel saves full http request but I want only attached file

心已入冬 提交于 2019-12-02 10:18:31
I have the following code base: @Component public class DummyRoute extends RouteBuilder { @Override public void configure() throws Exception { rest("/upload").post().to("file://rest_files"); } @Bean public ServletRegistrationBean servletRegistrationBean() { SpringServerServlet serverServlet = new SpringServerServlet(); ServletRegistrationBean regBean = new ServletRegistrationBean( serverServlet, "/rest/*"); Map<String,String> params = new HashMap<>(); params.put("org.restlet.component", "restletComponent"); regBean.setInitParameters(params); return regBean; } @Bean public org.restlet.Component

org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type:

时间秒杀一切 提交于 2019-12-02 04:05:53
I have multipart file in the first place and I want to send it to camel pipeline and save this file with original name. my code: @Autowired ProducerTemplate producerTemplate; ... producerTemplate.sendBody("seda:rest_upload", multipartFile); on another side I have: from("seda:rest_upload").convertBodyTo(File.class).to("file://rest_files"); And also I try to register converter: @Converter public class MultiPartFileToFileConvertor { @Converter public static File toFile(MultipartFile multipartFile) throws IOException { File convFile = new File(multipartFile.getOriginalFilename()); multipartFile

Could not save date field as ISO date in mongo db via Camel?

泄露秘密 提交于 2019-12-01 14:31:00
I have pojo like this: @Document(collection = "data") public class DataPoint { @Id private String id; private LocalDateTime createdDate; .... } in some code base I have following code: @Autowired private ProducerTemplate producerTemplate; ... final List<DataPoint> dataPoints =.... producerTemplate.sendBody("mongodb:mongoBean?database=" + mongoDataConfiguration.getDatabase() + "&createCollection=true&operation=insert&collection=" + mongoDataConfiguration.getDataPointCollection(), dataPoints); But when I open collection in database I see date field like this: "createdDate" : { "month" :