apache-camel

Binary File To SQL Database Apache Camel

你说的曾经没有我的故事 提交于 2019-12-12 08:59:12
问题 I need some guidance around which approach to use to load binary files from a folder into a MySQL Database using Camel. Basically I want to store voice logs from our PBX system into a database. The directory with the voice logs will be a remote directory I have designed a prototype but I am not sure if this is really efficient, it works but I am not happy with the design. Let me explain what I am doing. Camel route as follows: <camelContext xmlns="http://camel.apache.org/schema/spring">

What is the difference between SEDA, VM and direct in Apache Camel?

三世轮回 提交于 2019-12-12 08:10:56
问题 I had worked with both SEDA and direct, and I've also read the documentation. But I still cannot visualize the usage of SEDA and direct. Vm is new to me. Please explain it with an example. 回答1: There are at least four different mechanisms by which one Camel route can directly pass data to another. By "directly" I mean without using a network or some form of intermediate storage (file, database). These mechanisms can be grouped according to whether they can pass data between CamelContext

How do I marshall nested key,value pairs into JSON with Camel and Jackson library?

末鹿安然 提交于 2019-12-12 07:31:46
问题 I have a Java project that currently returns a map to Camel without any nested key,value pairs, and the Jackson library marshalls it just fine into JSON using the Jackson library. For example if I put the following two key,values into a demoMap: Map<String,String> demoMap = new TreeMap<String,String> demoMap.put("key1","5"); demoMap.put("key2","10"); I get the following JSON: {"key1":"5","key2":"10"} However, now some of my key,value entries will have an optional visibility that I need to put

apache restlet connector overload

↘锁芯ラ 提交于 2019-12-12 06:27:50
问题 I use restlet in camel route in from("restlet:http/myLink") clause. When user's requests more then ten per second, I begin recieve errors processing request like a "org.restlet.engine.connector.Controller run INFO: Connector overload detected. Stop accepting new work" I think, that error is caused by number of threads,request query's size or number,or something like that. I try set to maxThreads param different values in spring config <bean id="restlet" class="org.apache.camel.component

Send a SOAP request to a remote web service and get a response using apache Camel

老子叫甜甜 提交于 2019-12-12 05:50:06
问题 I'm doing a development to send a SOAP request to a remote web service and get a response using apache Camel . In this case, I succesfully generated Client Side wsdl2java Code using the cxf-codegen-plugin for the WSDl mentioned below. Sample WSDL URL : http://www.webservicex.net/stockquote.asmx?WSDL And after doing some researches, I created below sample code to send a SOAP request to the web service defined in there and get a response with apache Camel using the generated client code.

How do i use java boolean condition in camel route?

荒凉一梦 提交于 2019-12-12 05:15:43
问题 I am using camel to transfer files from one endpoint to another. I am starting multiple routes in which some routes need to decrypt the files. How can i make the unmarshal process optional in a specific route based on a boolean condition? from(source) .choice() .when(isEncrypted())) //Java boolean value .unmarshal(decrypt(pgpEncryptionDetails)) .endChoice() to(destination); PGPDataFormat decrypt(PGPEncryptionDetails pgpEncryptionDetails) { PGPDataFormat pgpDataFormat = new PGPDataFormat();

Apache camel file with doneFileName

泄露秘密 提交于 2019-12-12 05:12:21
问题 I am just starting to look at apache camel (Using blueprint routes) and I am already stuck. I need to process a set of csv files with different formats. I get 5 files with foo_X_20160110.csv were X specifies the type of csv file and the files have a date stamp . These files can be quite large so a 'done' file is written once all files are written. The done file is named foo_trigger_20160110.csv. I've seen the doneFileName option on file but that only supports a static name (I have a date in

Creating a drools route in Camel

↘锁芯ラ 提交于 2019-12-12 04:57:47
问题 I'm getting the following error while deploying a Camel route using the drools-camel component. This is how my route looks like. <route id="drools-route"> <from uri="direct:drools-ep" /> <policy ref="droolsPolicy"> <unmarshal ref="xstream" /> <to uri="drools:node1/ksession1" /> <marshal ref="xstream" /> </policy> </route> <bean id="droolsPolicy" class="org.drools.camel.component.DroolsPolicy" /> 268 [ http-bio-8080-exec-5] SpringCamelContext INFO Apache Camel 2.10-SNAPSHOT (CamelContext:

Can't add application.prop to Camel test

老子叫甜甜 提交于 2019-12-12 04:35:43
问题 I can't make my test use application.propperies in test envirement while on main it works fine. Write that it cant find such a propperty. I tried to use @TestPropertySource(locations="classpath:application.properties") but didn't help. Also added application.propperies to resource in test folder. My project structure My test class: @RunWith(SpringRunner.class) @SpringBootTest //@TestPropertySource(locations="classpath:application.properties") public class Excercise5to7ApplicationTests extends

Camel File2 component with recursive option. How to remove empty directory

人盡茶涼 提交于 2019-12-12 04:35:10
问题 When I set recursive=true&delete=true for Camel File2 component it looks into subdirectories. However, then file is processed it gets removed, but directory still exists. How to automatically remove such directory? Isn't there any options for this. If now - probably this should be added to the wish-list into Camel issue tracking? 回答1: This is not possible. The file component can only delete the file, not any directory. You will have to delete the directory yourself. 来源: https://stackoverflow