Saif Charaniya
Saif Charaniya

Reputation: 131

Dynamic From URI Camel

So, I have been use Camel with Jboss fuse for a few days, and am stuck on designing a camel route. What I have is an api that returns JSON objects and that can be accessed from a url and which requires a start and end time in UTC milliseconds such as http://somelog.com?start=1465325280000&end=1465325281000

What I would like to do is have camel fetch the JSON objects from the api every dx milliseconds and begin at time x_i

I thought about used a timer with the date function, but the date command does not provide UTC milliseconds.

Upvotes: 0

Views: 238

Answers (1)

Ninja Code Monkey
Ninja Code Monkey

Reputation: 216

Use a camel:timer to trigger a Processor that builds the URL you need to invoke, then set it as header 'Foo'. You should be able to then reference in route using RecipientList EIP, like so:

  from("timer:tmr...")
      .to("bean:uriBuilder")
      .recipientList("${Foo}")
      .to("bean:resultsHandler");

Upvotes: 1

Related Questions