camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jelmer <>
Subject Re: Polling http endpoints
Date Thu, 03 Mar 2016 18:44:10 GMT
Since no one answered I came up with this :

      .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.POST))
      .setHeader(Exchange.CONTENT_TYPE, constant("multipart/form-data"))
      .setHeader(Exchange.HTTP_PATH, constant("/api/tasks"))

      .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
      .setHeader(Exchange.HTTP_PATH, body().convertToString())
        .when().jsonpath("[?(@.state == 'completed')]")
          .log("Task was not yet completed retrying in 2 seconds")

Does this make any sense ?

On 2 March 2016 at 21:27, jelmer <> wrote:

> Hi as part of a camel route i upload a file to a REST service, the service
> will return status 202 and a Content-Location header that points to a json
> resource with a status field
> i want to wait for the status of this resource to change to completed, and
> only then continue. so i need some sort of polling
> But i don't see an obvious way to do this in camel
> can anyone offer any suggestions?

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