apache-camel

Apache Camel: RouteBuilder with CxfEndpoint

你。 提交于 2019-12-21 05:17:17
问题 Hello! I'm trying to implement a Camel route with Java DSL and RouteBuilder. I want to send from a timer endpoint to a cxf endpoint. Code: public class MyRoute extends RouteBuilder { @Override public void configure() { CamelContext camelContext = getContext(); CxfEndpoint cxfEndpoint = new CxfEndpoint(); cxfEndpoint.setAddress("http://localhost:8088/interface"); cxfEndpoint.setWsdlURL("wsdl/contract.wsdl"); cxfEndpoint.setCamelContext(camelContext); cxfEndpoint.setDataFormat(DataFormat

Spring configuration for multiple Activemq remote brokers

天涯浪子 提交于 2019-12-21 04:18:19
问题 How to configure multiple remote activemq brokers (different IP address) in spring context? Below is the configuration for 1 remote broker. I am using camel to create routes that produce and consume messages from and to different queues in multiple remote brokers. Based on the following routes, how do the system knows which remote broker each queue belongs to? List item from("direct:start").to("activemq:queue:outgoingRequests") List item from("activemq:queue:incomingOrders").to("log:Events?

Camel: Splitting a collection and writing to files

不想你离开。 提交于 2019-12-21 03:44:21
问题 I´m trying to split an ArrayList and writing each element to it´s own file using Apache Camel like in this simplified example: from("timer://poll?period=10000").process(new Processor(){ public void process(Exchange exchange){ ArrayList<String> list = new ArrayList<String>(); list.add("one"); list.add("two"); list.add("three"); exchange.getIn().setBody(list, ArrayList.class); } }).split(body()).log(body().toString()).to("file:some/dir"); The log prints each item but only "three" is saved to a

Camel - Exception handling in 'sub routes'

别来无恙 提交于 2019-12-20 19:43:12
问题 Camel explicitly handles two 'scopes' of error handling: Global per Route The issue I'm having is exceptions thrown in a 'sub route'. For instance, I've got this route: from("direct:sendToWebservice"). .processRef("massageBeforeSending"). .to("http://webservice.com"). .processRef("massageResponse"); Then I've got two other routes that need to send messages to the webservice: from(direct:fromSystemA"). .errorHandler(deadLetterChannel("direct:TellSystemA")). .to("direct:sendToWebservice"); from

Apache Camel: how store variable for later use

谁都会走 提交于 2019-12-20 17:39:44
问题 while 'playing around' with Camel using Spring DSL, I came across the following problem. Suppose the expected message flow looks like this: client sends HTTP POST message with XML body to CAMEL CAMEL proxies HTTP POST message towards server, with the URI slightly adapted using info from the received XML body (eg: use XPATH to filter out a certain parameter) after CAMEL has received a reply, CAMEL sends HTTP PUT message towards server, using parameters out of the XML body received in 1 So

Apache Camel ftp consumer loads the same files again and again

牧云@^-^@ 提交于 2019-12-20 14:19:21
问题 I have following spring configuration <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="downloadLogger" class="com.thomsonreuters.oa.sdi.camel.DownloadLogger" /

Work Flow in Camel vs BPM

白昼怎懂夜的黑 提交于 2019-12-20 12:37:14
问题 We have used Apache camel as a Workflow engine.First Wehave WebService One and wait for the response and based on the response call WebService 2 or WebService 3.Its a pure WorkFlow and have couple of WorkFlow Steps like this.I have got less chances to work on a BPM product , like JBOSS BPM etc. Other than long running and support for human task any other good reason we have to choose a BPM product ? If both long running and human task support are not needed in our project can we use Camel or

Content-Type is not supported in Camel DELETE method?

余生长醉 提交于 2019-12-20 07:24:34
问题 How do i send content-type in Camel DELETE method. I have added the following way but It was not working correctly. from("direct:start") .setHeader(Exchange.HTTP_METHOD, simple("DELETE")) .setHeader(Exchange.CONTENT_TYPE, simple("application/xml")) .setHeader(Exchange.HTTP_URI, simple("http://02.02.02.02:8080/rest/delete/student/688187")) .to("http://emptyhost"); Could you please help me to resolve this issue? 回答1: As in a delete operation, no content is sent, the Exchange.CONTENT_TYPE

Apache Camel + Spring (war) + Tomcat + REST

限于喜欢 提交于 2019-12-20 07:06:34
问题 I am trying to develp a rest service using apache camel. My project is a spring mvc war deployed on tomcat. I dont want to use apache cxf (cxf servlet). public class SampleRouter extends RouteBuilder { @override public void configure() throws Exception { from("cxfrs://http://localhost:1234/sample") .process (new Processor() { public void process(Exchange exchange) throws Exception { System.out.println("test"); } })).setBody(constant("SUCCESS")); } } @Path("/sample") public class

Why is my Camel Netty route adding newlines to the start of my JMS messages?

好久不见. 提交于 2019-12-20 06:32:48
问题 I have a Camel Netty route that takes XML sent to a server port and places it in a JMS message. After the first message, every other message has a newline at the top of the message, causing my XML to fail to unmarshall when a GUI receives it. My route look like this: <route> <from uri="netty4:tcp://localhost:5150?decoders=#customFrameDelimeterDecoder,#string-decoder&encoder=#string-encoder"/> <to uri="jms:topic:my.company.topic"/> </route> Note: The XML is not newline terminated, hence the