camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Debraj Manna <>
Subject Camel - Making parallel GET requests and aggregating the results via Dynamic Routes using Java DSL
Date Tue, 18 Oct 2016 10:53:29 GMT
I am receiving a request on a Jetty Http Endpoint. The request body
contains some urls in the request body. I have to make a GET request to
those urls. Then aggregate the results from each of the GET request and
return it to the caller.

Request Body:-

    "data" : [
        {"name" : "Hello", "url" : "http://server1"}
        {"name" : "Hello2", "url" : "http://server2"}


One way I can think of doing this is like below:-

from("jetty:http://localhost:8888/hello").process(new Processor() {
    public void process(Exchange exchange) throws Exception {
        // 1. Make the GET request in parallel using ThreadPoolExecutor
        // 2. Wait for all calls to finish. Collate the response
        // 3. Write it to exchange.getOut().setBody

Can some one let me know if this can be achieved via Java DSL using camel
dynamic Routes, splitter & aggregator so that my Processor remains
relatively small?

I am using camel 2.16.3.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message