apache-camel

Apache Camel and web services

徘徊边缘 提交于 2019-12-01 21:12:42
问题 I am trying to understand how to integrate Apache Camel with any web service that provides a WSDL to generate its classes to afterward call his methods to return some requests. I've studied a little about camel-spring-ws and camel-cxf packages. As I can see Spring Web Services Component does not support the use of WSDL but CXF does, however it only supports connections with JAX-WS services hosted in CXF. If I receive a WSDL from a customer, could I use CXF? Or would I need to create a custom

Unzip a file using Apache Camel UnZippedMessageProcessor

◇◆丶佛笑我妖孽 提交于 2019-12-01 21:09:59
Trying to unzip a file using Apache Camel, I tried the example given in http://camel.apache.org/zip-file-dataformat.html but I can't find UnZippedMessageProcessor class. Here's the code: import java.util.Iterator; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.dataformat.zipfile.ZipFileDataFormat; public class TestRoute extends RouteBuilder { @Override public void configure() throws Exception { ZipFileDataFormat zipFile = new ZipFileDataFormat(); zipFile.setUsingIterator(true); from("file:src/test/resources/org/apache/camel/dataformat/zipfile/") .unmarshal(zipFile).split

Camel - content enricher: enrich() vs pollEnrich()

和自甴很熟 提交于 2019-12-01 16:46:42
1ST QUESTION: I'm not able to really understand the difference between enrich() and pollEnrich() . Maybe the terms Camel uses are not so great. I read here: http://camel.apache.org/content-enricher.html Content enrichment using the enrich DSL element Camel comes with two flavors of content enricher in the DSL enrich pollEnrich enrich uses a Producer to obtain the additional data. It is usually used for Request Reply messaging, for instance to invoke an external web service. pollEnrich on the other hand uses a Polling Consumer to obtain the additional data. It is usually used for Event Message

Camel - content enricher: enrich() vs pollEnrich()

北城以北 提交于 2019-12-01 15:28:08
问题 1ST QUESTION: I'm not able to really understand the difference between enrich() and pollEnrich() . Maybe the terms Camel uses are not so great. I read here: http://camel.apache.org/content-enricher.html Content enrichment using the enrich DSL element Camel comes with two flavors of content enricher in the DSL enrich pollEnrich enrich uses a Producer to obtain the additional data. It is usually used for Request Reply messaging, for instance to invoke an external web service. pollEnrich on the

Apache Camel with Json Array split

笑着哭i 提交于 2019-12-01 14:57:40
I have a camel application which receives a json array request from a jms queue upto size 13000,the structure of the json array request is as below. I would like to stream and split the json array with a group of 5. For example if I receive a json array of size 100 I would like to group as 5 and split it as 20 requests. Is there a inbuilt camel functionality to group and split json array or do I need to write a custom splitter? I'm using camel 2.17 version. Sample json array: [{ "name": "Ram", "email": "ram@gmail.com", "age": 23 }, { "name": "Shyam", "email": "shyam23@gmail.com", "age": 28 },

Spring Boot Apache Camel Routes testing

你说的曾经没有我的故事 提交于 2019-12-01 14:43:02
I have a Springboot application, where I have some camel routes configured. public class CamelConfig { private static final Logger LOG = LoggerFactory.getLogger(CamelConfig.class); @Value("${activemq.broker.url:tcp://localhost:61616}") String brokerUrl; @Value("${activemq.broker.maxconnections:1}") int maxConnections; @Bean ConnectionFactory jmsConnectionFactory() { PooledConnectionFactory pooledConnectionFactory = new PooledConnectionFactory(new ActiveMQConnectionFactory(brokerUrl)); pooledConnectionFactory.setMaxConnections(maxConnections); return pooledConnectionFactory; } @Bean public

TypeConversion Exception : Apache Camel and CXF

本小妞迷上赌 提交于 2019-12-01 14:42:25
I am trying to integrate CXF restful web services with Apache Camel. I am getting the following exception when I send a request to my web service: Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.cxf.message.MessageContentsList to the required type: java.io.InputStream with value [null] at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:147) at org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:100) ... 68 more I am pasting a section of

Apache Camel Spring configuration error - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

本秂侑毒 提交于 2019-12-01 14:40:00
问题 I've posted an excerpt from my spring.xml file and the stack trace I'm getting. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:util="http://www.springframework.org/schema/util" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans

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" :

TypeConversion Exception : Apache Camel and CXF

瘦欲@ 提交于 2019-12-01 12:36:19
问题 I am trying to integrate CXF restful web services with Apache Camel. I am getting the following exception when I send a request to my web service: Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.cxf.message.MessageContentsList to the required type: java.io.InputStream with value [null] at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:147) at org.apache