apache-camel

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

Mock Apache Camel out location in JUnit testing

蹲街弑〆低调 提交于 2019-12-02 03:53:29
问题 I am trying to mock in and out paths of Camel Routes but I don't know how to provide mock in and out path.Please help me to fix this.Thanks in advance. application.properties inputFilePath = src/main/resources/in outputFilePath = src/main/resources/out application-test.properties inputFilePath = src/test/java/in outputFilePath = src/test/java/out Router and Processor: @Component public class FileLineByLineRouter extends RouteBuilder { @Value("${inputFilePath}") private String inputFilePath;

Apache Camel: Reply received for unknown correlationID

﹥>﹥吖頭↗ 提交于 2019-12-02 03:39:51
There is a middleware in between of two other software components. In the middleware I'm routing Apache ActiveMQ messages by Apache Camel . this is how it works: 1stComponent uses middleware to send message to the 3rdComponent 3rdComponent replies the message and sends it back to the 1st (using middleware ). 1stComponent <<=>> Middleware <<=>> 3rdComponent Problem: I'm using ConcurrentConsumers in middleware. In the middle of sending a lot of messages sequentially, suddenly middleware stops all the process! there is no exceptions or messages! for example, first 100 of 500 messages got

How to set ApplicationIdData using MQQueueConnectionFactory?

我们两清 提交于 2019-12-02 03:26:57
Trying to figure out the camel/Spring configuration to set ApplicationIdData using JMS. I know the java way to do it as below, I set MQOO_SET_IDENTITY_CONTEXT using below int putOptions = MQConstants.MQPMO_SET_IDENTITY_CONTEXT; pmo.options =putOptions; and then i set applicationIdData as: MQMessage msg = new MQMessage(); msg.applicationIdData = "SomeId"; msg.writeString(qmessage); queue.put(msg, pmo); Question is, How do I set applicationIdData using JMS/camel/Spring configuration . Below is my current camel configuration. <bean class="org.apache.camel.component.jms.JmsComponent" id=

Set redis key/value with camel-redis

穿精又带淫゛_ 提交于 2019-12-02 02:57:11
I want to set a key/value pair using camel-redis. I try: spring-redis://localhost:6379?command=SET&CamelRedis.key=testkey&CamelRedis.value=100 but no joy. I get the error: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{key=testkey, value=100}] Although there are plenty of examples about how to subscribe etc. I do not find a single example on how to set a key/value pair. How would I do that? CamelRedis.Key and CamelRedis.Value (beware they are case sensitive) are

Set redis key/value with camel-redis

我是研究僧i 提交于 2019-12-02 02:39:23
问题 I want to set a key/value pair using camel-redis. I try: spring-redis://localhost:6379?command=SET&CamelRedis.key=testkey&CamelRedis.value=100 but no joy. I get the error: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{key=testkey, value=100}] Although there are plenty of examples about how to subscribe etc. I do not find a single example on how to set a key

Mock Apache Camel out location in JUnit testing

假如想象 提交于 2019-12-02 01:12:52
I am trying to mock in and out paths of Camel Routes but I don't know how to provide mock in and out path.Please help me to fix this.Thanks in advance. application.properties inputFilePath = src/main/resources/in outputFilePath = src/main/resources/out application-test.properties inputFilePath = src/test/java/in outputFilePath = src/test/java/out Router and Processor: @Component public class FileLineByLineRouter extends RouteBuilder { @Value("${inputFilePath}") private String inputFilePath; @Value("${outputFilePath}") private String outputFilePath; @Override public void configure() throws

Unzip a file using Apache Camel UnZippedMessageProcessor

孤人 提交于 2019-12-02 01:11:28
问题 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

Apache Camel and web services

独自空忆成欢 提交于 2019-12-02 01:03:29
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 component to use his methods? As far as I can see the simplest way to implement it would be creating a

How to transactionally poll Kafka from Camel?

断了今生、忘了曾经 提交于 2019-12-02 00:19:19
I'm currently working on message bus based on kafka and managed by camel and Spring. I have a XML route definition to poll events and retrieve the corresponding complete business objects from an external API that looks like that : ` <route id="station-event-enrich-route" autoStartup="true" > <from uri="kafka:{{kafka.cluster.url}}?brokers={{kafka.cluster.url}}&topic={{events.topic.name}}&autoCommitEnable=false&allowManualCommit=true&maxPollRecords={{station.brocker.bulk.limit}}&groupId={{kafka.groupId}}" /> <!-- SNIP logic to aggregate several events --> <pollEnrich strategyRef=