apache-camel

Apache Camel split JSONArray remove the double quote

落花浮王杯 提交于 2020-01-17 05:48:26
问题 I've split the JSONArray using JsonPathExpression, but the result removed every double quote in each JSON, here is my RouteBuilder. from("timer:scheduler?repeatCount=1") .to("http:localhost:8901/rest/getData") .split(new JsonPathExpression("$.[*]")) .process(new Processor() { @java.lang.Override public void process(Exchange exchange) throws Exception { String input = exchange.getIn().getBody(String.class); exchange.getIn().setBody(input); } }) .unmarshal().json(JsonLibrary.Jackson, Map.class)

How configure timeout for apache camel jetty component

两盒软妹~` 提交于 2020-01-17 04:36:07
问题 I use Talend Open Studio 5.6 ESB, I make a apache camel route. The end of my route is : .removeHeaders("CamelHttpPath") .removeHeaders("CamelHttpUrl") .removeHeaders("CamelServletContextPath") .to("jetty:http://toOverRide?bridgeEndpoint=false&throwExceptionOnFailure=false&useContinuation=false&httpClient.timeout=120000&httpClient.idleTimeout=120000") Before this, I overide the url in the jetty component for call a remote service. This service takes 30 seconds to reply, the route closes the

Apache Camel - Delay when exception occurs

寵の児 提交于 2020-01-17 01:53:08
问题 I have written a camel route that polls a file folder, picks up request, checks for memory consumption on server (in a java file). If its below threshold it drops the request on a JMS queue otherwise it throws an exception and picks it again for processing. What i need to do is that when exception is thrown i need to delay processing for a configurable amount of time say 15 mins. This will give some time for server to stabilize instead of keeping it polling unnecessarily. I am using

joinTransaction has been called on a resource-local EntityManager in ApacheCamel

﹥>﹥吖頭↗ 提交于 2020-01-16 11:20:29
问题 I am new to apache camel and I am testing camel-jpa to poll from table and display records Following is main class EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LoanServicePU"); CamelContext camelContext = new DefaultCamelContext(); JpaComponent jpa = new JpaComponent(); jpa.setEntityManagerFactory(entityManagerFactory); JpaTransactionManager myTM=new JpaTransactionManager(); myTM.setEntityManagerFactory(entityManagerFactory); jpa.setTransactionManager(

Complete Async web service communication - sender and receiver are not available same time

China☆狼群 提交于 2020-01-16 08:59:17
问题 Two systems are talking to each other through integration(Using apache-camel). Let say system A needs to submit a request to System B which has exposed a web service to receive data and integration is transforming data as per system B web service. In above scenario A and B has to be available same time and A will have to wait for response from B. I need to remove this dependency by putting queue at integration layer and with Async communication. Ex: <camel:route id="AtoIntegration"> <camel

How to rename and move the file on FTP once processed by camel?

北城以北 提交于 2020-01-16 02:51:48
问题 I have several folders on my ftp: /csv /xml /processed /.... How can I rename and move each file once it has been processed from file.csv to file.done and move it to processed folder ? I have tried many options like adding tons of parameters to "from" or add something into onCompletion or adding several more routes for just moving files. All placeholders contain correct values and are processed by Spring. <route> <from uri="ftp://{{ftp.user}}@{{ftp.server}}/{{inbound.csv}}?password={{ftp.pass

How to rename and move the file on FTP once processed by camel?

末鹿安然 提交于 2020-01-16 02:51:38
问题 I have several folders on my ftp: /csv /xml /processed /.... How can I rename and move each file once it has been processed from file.csv to file.done and move it to processed folder ? I have tried many options like adding tons of parameters to "from" or add something into onCompletion or adding several more routes for just moving files. All placeholders contain correct values and are processed by Spring. <route> <from uri="ftp://{{ftp.user}}@{{ftp.server}}/{{inbound.csv}}?password={{ftp.pass

Customizing a name of a thread in camel

天涯浪子 提交于 2020-01-16 00:50:09
问题 How do I customise a thread name of a particular component in Apache Camel? 回答1: See http://camel.apache.org/threading-model.html: <camelContext xmlns="http://camel.apache.org/schema/spring" threadNamePattern="Riding the thread #counter#"> <route> <from uri="seda:start"/> <to uri="log:result"/> <to uri="mock:result"/> </route> </camelContext> 回答2: Thanks for your reply peter.I want to know how do i customise a thread name for particular component? For Ex: <camelContext threadNamePattern=

How to set HTTP headers on Camel http4 endpoint

百般思念 提交于 2020-01-15 09:10:23
问题 How does one set the headers for a request made using the http4 component in Camel? The site I'm connecting to requires the referrer header to be set. Using HttpClient directly, one can add headers to the request, but I can't see how that's exposed in Camel. ETA: Working example based on the accepted answer: from("timer://foo?fixedRate=true&delay=0&period=300000") .setHeader("Referer", constant("https://example.com")) .to("https4://www.example.com") 回答1: You should just be able to set it as a

How to get Spring to wire my JmsComponent

限于喜欢 提交于 2020-01-15 07:56:33
问题 I am writing an application using Akka, Akka-Camel and Spring for configuration. The application needs to act as a standalone JMS client against a variety of application servers, to which end it needs to set up the JMS connection factory using JNDI. I'm testing this with jBoss. I have the same problem with jBoss 5 and 6 (this seems to be a client-side Spring problem, not related to jBoss). I am configuring the Spring beans with this xml: <beans xmlns="http://www.springframework.org/schema