apache-camel

Test All Process and Routes of Apache Camel Junit

↘锁芯ラ 提交于 2019-12-11 16:56:51
问题 I am trying to validate all the processes of route but start is working fine after that it started to break.Please give me some useful reference or sample for this.Thanks in advance. test.txt: F1:L1 F2:L2 F3:L3 Customer.java private String firstName; private String lastName; // getters and setters @Override public String toString(){ return firstName +":::" + lastName; } } JUnit and Route: public class FileTest7 extends CamelTestSupport { @EndpointInject(uri = "direct:teststart") private

PGP Encryption with Apache Camel

强颜欢笑 提交于 2019-12-11 16:31:24
问题 I am trying to encrypt and decrypt a file using PGP Encryption/Decryption methodology with Apache Camel. Further I have installed Kleopatra to generate the private and public keys. Using Kleopatra i have generated my keys successfully. The secret key and public keys are in ".asc" extension. Below is the piece of code i am using to encrypt the file import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; public class

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

Persisting failed messages in Camel's SEDA queue

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 16:21:50
问题 I am using seda queue as dead letter channel endpoint. It works fine if network is down or other application is down. What will happen if I restart my own system? Will I loose my messages in dead letter channel endpoint SEDA queue? 回答1: The seda endpoint is not a reliable message solution, meaning any messages sent to a seda destination are subject to loss in the event of a failure/restart. If JMS is not an available solution you will need to provide your own persistence logic to provide

Apache Camel CXF empty response when handling exception

走远了吗. 提交于 2019-12-11 16:14:03
问题 This question is related to the previous one : Apache Camel multicast, exception and Aggregation strategy I think I missunderstood the problem when asking the previous question. I try to handle exception I thrown in my route. .filter(not(successResponsePredicate)) .to("log:com.sdmo.Error?level="+LOG_LEVEL) .transform(simple("Erreur lors de l'appel copyItem")) .process(new ConvertCartResponseProcessor()) .throwException(new Exception("copyItemError")) .end() The exception is handled through

Camel component endpoints options for password is altered, how to prevent this?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 16:11:23
问题 In Camel I am using the http4 component to make REST request on a remote server. The component documentation states that the credentials should be put in the options on the endpoint like this: https4://myremote.server.com/?authUsername=xxx&authPassword=yyy This was working well until someone put a password with a '+' character on another environment. We notice that the '+' character is transmitted as a space in the server which generates an error. By searching deeper in the Camel

Aggregate with xslt

被刻印的时光 ゝ 提交于 2019-12-11 15:49:13
问题 I am trying to aggregate message after getting data from database. It seems to be hard to explain to I will draw a flow firstly. [ORIGINAL_DOCUMENT] --> SPLIT[GET SOME IDs from ORIGINAL_DOCUMENT] --> [GET DATA FROM DATABASE USING MYBATIS] --> [ENRICH ORIGINAL_DOCUMENT BY GOT DATA FROM DATABASE] first route: <route id="enrich-zamowienie"> <from uri="activemq:queue:original-document"/> <setHeader headerName="pure-xml"> <simple>${body}</simple> </setHeader> <split> <xpath>original-document/entry

Read all files at once in Apache Camel file component

牧云@^-^@ 提交于 2019-12-11 15:38:19
问题 I have a Spring Boot scheduler that calls an Apache Camel Route. The Route reads a directory and transfers the files in that directory to another directory. Below is the Scheduler code: @Component public class Scheduler { @Autowired private ProducerTemplate producerTemplate; @Scheduled(cron = "#{@getCronValue}") public void scheduleJob() { System.out.println("Scheduler executing"); producerTemplate.sendBodyAndHeaders("direct:transferFile", null, null); System.out.println("Scheduler complete")

BeanIO - lietral is coming as extra line

断了今生、忘了曾经 提交于 2019-12-11 14:43:21
问题 Please help me to remove unwanted extra lines for below part. Current Output: 001 Name1Str1 CA 1234 001 Name2Str2 IN 4321 005 30Manager Technology 005 50Lead Technology Java Code: ArrayList<Employees1> emps = new ArrayList<>(); ArrayList<Employee1> empp1 = new ArrayList<>(); ArrayList<Employee2> empp2 = new ArrayList<>(); Employees1 employees = new Employees1(); Employee1 emp1 = new Employee1(); emp1.setSno("001"); emp1.setName("Name1"); emp1.setStreet("Str1"); emp1.setCity("CA"); emp1.setZip

Reading file content using file name from db in camel

半世苍凉 提交于 2019-12-11 14:40:00
问题 I have to do a query in db to get the filenames from a table. And then I have to read the contents of files in a folder/directory using the file names I got from query. I have done the query part and stored the list of filenames in Exchange using a bean. But I am wondering how can I use this filenames in exchange to read the file contents. Could you please help? 回答1: You can use the pattern Content Enricher (http://camel.apache.org/content-enricher.html) and Camel 2.16 with dynamic endpoints