apache-camel

How Camel 2.11 batch aggregation works with separate route?

回眸只為那壹抹淺笑 提交于 2019-12-30 09:55:35
问题 First there is a similar unanswered question Joining routes into single aggregator We have some consumer routes (ftp, file, smb) reading files from remote systems. Simplified for test with direct route, but similar behavior with batch consumers: from("direct:"+routeId).id(routeId) .setProperty(AGGREGATION_PROPERTY, constant(routeId)) .log(String.format("Sending (${body}) to %s", "direct:start1")) .to("direct:aggregate"); After transformation all results from one poll are aggregated by batch

Testing Camel with MockEndpoints

若如初见. 提交于 2019-12-30 03:49:06
问题 I've got a series of "pipelined" components that all communicate through ActiveMQ message queues. Each component uses Camel to treat each of these queues as an Endpoint. Each component uses the same basic pattern: Where each component consumes messages off of an input queue, processes the message(s), and then places 1+ messages on an outbound/output queue. The "output" queue then becomes the "input" queue for the next component in the chain. Pretty basic. I am now trying to roll up my sleeves

Apache Camel http to http routing (Is it possible?)

℡╲_俬逩灬. 提交于 2019-12-29 05:10:27
问题 I am starting now with Camel. I have seen the http4 component for http clients and the jetty component for http servers. I have seen several examples that use one or the other. I would like to know if it is possible to combine them together. Example from("jetty:http://0.0.0.0:8080/myapp/myservice") .to("http4://www.google.com"); This would make camel a simple http based router/proxy. Web browsers would hit the camel URL and instead get google. (Google is just an example, I have a real POST

How to use a dynamic URI in From()

眉间皱痕 提交于 2019-12-29 01:42:10
问题 As mentioned in Apache Camel, it allows to write dynamic URI in To(), does it allows to write dynamic URI in From(). Cause I need to call the multiple FTP locations to download the files on the basis of configuration which I am going to store it in database. (FTPHost, FTPUser, FTPPassword, FTPSourceDir, FTPDestDir) I will read these configuration from the DB and will pass it to the Camel route dynamically at runtime. Example: This is the camel route example that I have to write dynamically

Activemq-camel: can not use <to uri=“http://…”>

瘦欲@ 提交于 2019-12-25 19:06:20
问题 I want help to solve this problem, the following code is in bean.xml gives me error <camelContext id="activeContext1" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq:queue:ThermalMap"/> <to uri="http://myhost:8161/Example?throwExceptionOnFailure=false"/> </route> </camelContext> Error I get: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[http://myhost:8161/Example

Failed to create route route1

不想你离开。 提交于 2019-12-25 16:46:45
问题 i have a trouble solving this exception and i don't know where i'm doing wrong. here's the Exception. org.apache.camel.spring.boot.CamelSpringBootInitializationException: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> Filter[bean[ref:filter method:accept] -> []] <<< in route: Route(route1)[[From[file:D:/copyy/?noop=true]] -> [Filter[be... because of Definition has no children on Filter[bean[ref:filter method:accept] -> []]

Camel unit testing with MockEndPointsandSkip

穿精又带淫゛_ 提交于 2019-12-25 12:03:39
问题 Am a Camel newbie and am trying out some code to understand how the MockEndpoints functionality works, but it is not working. Here are my Camel routes that I want to unit test using MockEndpoints. The property values are defined in the application.properties file. from("kafka:{{kafka.servers}}?topic={{kafka.consumer.topic}}&groupId={{kafka.consumer.groupId}}") .to("direct:notify"); from("direct:notify") .log("direct:notfy"); Here is my Test code which is failing the assertion of receiving 1

Camel unit testing with MockEndPointsandSkip

耗尽温柔 提交于 2019-12-25 12:03:14
问题 Am a Camel newbie and am trying out some code to understand how the MockEndpoints functionality works, but it is not working. Here are my Camel routes that I want to unit test using MockEndpoints. The property values are defined in the application.properties file. from("kafka:{{kafka.servers}}?topic={{kafka.consumer.topic}}&groupId={{kafka.consumer.groupId}}") .to("direct:notify"); from("direct:notify") .log("direct:notfy"); Here is my Test code which is failing the assertion of receiving 1

how to set jms message custom header using xpath in camel route

瘦欲@ 提交于 2019-12-25 11:25:59
问题 I am using camel route builder to move one activemq jms message from one queue to another by setting some custom header, by using xpath to read the node value from xml. nothing has been set. Please suggest if you know the answer. from("activemq:com.queue1") .setHeader("orderNumber").xpath("/orderRequest/authNumber") .to("activemq:com.queue2") .end(); XML would look like <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:orderRequest xmlns:ns2="http://www.company.com/services/entity

How to aggregate CSV lines with Apache Camel?

不打扰是莪最后的温柔 提交于 2019-12-25 08:57:44
问题 I have a CSV similar to this: County City Area Street county1 city1 area1 street1 county1 city1 area2 street2 county1 city1 area3 street7 county1 city2 area2 street2 county1 city2 area6 street1 county2 city1 area3 street3 county2 city1 area3 street2 ... During the CSV parsing, I need to aggregate the same County/City to create a final structure like this: county1/city1: [ [area1, street1], [area2, street2], [area3, street7] ] county1/city2: [ [area2, street2], [area6, street1] ] county2/city1