apache-camel

camel-hdfs2 No FileSystem for scheme: hdfs

耗尽温柔 提交于 2020-01-03 05:21:42
问题 I got the some errors when I use camel-hdfs2 in my OSGI project(base on karaf) My environment: Apache Karaf v4.0.4 Apache Camel v2.15.2 Apache Camel hdfs2 v2.15.2 Error is: No FileSystem for scheme: hdfs Error detail: 2016-07-07 15:59:52,141 | ERROR | pool-14-thread-1 | BlueprintCamelContext | 36 - org.apache.camel.camel-blueprint - 2.15.2 | Error occurred during starting Camel: CamelContext(intelligenceCollectorWorkCamelContext) due Failed to create Producer for endpoint: Endpoint[hdfs2:/

Camel Mock test using file as input

柔情痞子 提交于 2020-01-03 03:33:06
问题 I want to create a Mock Test for a Camel route which uses as input a file: <route id="myroute"> <from uri="file:/var/file.log&noop=true" /> . . . </route> So far I have been able to include a "direct:start" element at the beginning of the route and include manually the file as body:: context.createProducerTemplate().sendBody("direct:start", "data1-data2-data3"); I guess there must be a better way for doing it, without changing the original Spring XML file. Any help ? Thanks 回答1: You can

Using Circuit Breaker with camel -ThrottlingExceptionRoutePolicy

≯℡__Kan透↙ 提交于 2020-01-03 03:28:11
问题 There is a route which is consuming messages from a jms queue and after doing some processing sending a request to unreliable web service(Which can be down at times). So in case of service is down then i need to stop consuming from queue for some time. I tried to use ThrottlingExceptionRoutePolicy . It will stop route as per configuration but issue is for the current message which gets the error as message is getting moved to dead letter queue. I've gone through the code of

How to time portions of an apache camel route?

核能气质少年 提交于 2020-01-03 02:56:13
问题 I have a camel application that has many routes defined in a route builder. One of the routes has an xslt pipeline I would like to log the performance of in splunk. The format of the log needs to be: PerformanceDetailResultMs=<numberOfMsTheXsltsTook> I have tried doing the following which does not work because the result of System.currentTimeMillis() is held onto by spring and thus when the routeBuilder class executes whatever values were extracted at that time are held onto: from(direct

How to configure Camel CXF with Basic authentication

余生颓废 提交于 2020-01-03 02:36:06
问题 I'm new to Apache Camel and CXF, I'm trying to create a route for querying a remote WS which requires Basic Authentication and to specify the Soap Action header. I was able to achieve the same using camel HTTP component but i needed the same with camel CXF in java DSL Can anyone guide us in fixing the same 回答1: If you want to use camel-cxf component to setup the Basic authentication, you need do some configuration on the CxfEndpoint just like this. CxfEndpoint cxfEndpoint = camelContext

Camel replace all CRLF with LF using Simple DSL

最后都变了- 提交于 2020-01-03 02:20:27
问题 I am trying to replace the CRLF of the input data with LF but this is breaking the route. My code is as shown below from(fromEndpoint) .convertBodyTo(byte[].class, "iso-8859-1") .setBody(simple("body.replaceAll(\r\n, \n)")).... if I take the setbody out it works perfect. I just want platform dependent line feeds Any ideas what I am doing wrong? Thanks 回答1: solved with this from(fromEndpoint) .convertBodyTo(byte[].class, "iso-8859-1") .setBody(body().regexReplaceAll("\\r\\n", "\\\n")) 来源:

Apache Camel: Hiding Middleware APIs

走远了吗. 提交于 2020-01-03 00:54:17
问题 It is related to my previous question. How does Hiding Middleware APIs work exactly? Do I have to create interfaces so that they can send message to a serviceURL ? So I can not use proxy interfaces for anything else.Right? I was wondering if I can do some processing in the implementation class and return the result of that to serviceURL . And If I have 20+ camel routes in my applicationContext.xml , Would I end up including 20+ interfaces as proxy beans? May be that's how Camel works. But I

Camel route to filter out the auto response emails

只谈情不闲聊 提交于 2020-01-03 00:53:34
问题 I am using camel rout to consume the emails from my inbox folder. But I want to filter out the auto responded emails like out of offices etc. I see there is a option for to process only unread messages by using option unseen=true . The URI that I am using to consume the emails looks like: pop3://username@host?password=password;delete=true&unseen=true&consumer.delay=60000 回答1: I think what you're looking for is the searchTerm property to add to your endpoint URI. If you want to filter out e

How to mock multiple components in camel unit test?

跟風遠走 提交于 2020-01-02 11:16:07
问题 I'm using the CamelTestSupport in camel version 2.13.1. I'd like to do something like this to mock out two different components: @Override public String isMockEndpoints() { return "(activemq|exec)*"; } I can't just mock everything with "*" because I was getting errors from the activiti framework I'm using, which relies on the activiti component. Have any of you found a way to do something like this? 回答1: You can use regular expression, so its something a like: return "(activemq.*|exec.*)" See

Is it possible to build a Reactive Application using a non-Functional language?

依然范特西╮ 提交于 2020-01-02 07:12:22
问题 I would like to understand if the principles behind the Reactive Application manifesto can be achieved using a non-functional language . Some people say that since FP use immutable states and free side-effects functions, they are easier to implement concurrent, distributed and resilient systems. But how can we achieve that using Java for example? There are some frameworks like Apache Camel, that have some components to work with, like Camel RX , and Camel SEDA . Are these frameworks enough? I