Camel newbie here and still trying to learn the basics. I have a route based
on the HTT4 component where I have a MaxRedelivery option set like this:

  from("direct:HLTH.HttpOutbound")
      .errorHandler(defaultErrorHandler()
        .maximumRedeliveries(3)
        .redeliveryDelay(30000)
      .setHeader(Exchange.HTTP_URI, header("HTTP_URI"))
      .setHeader("CamelHttpMethod", constant("POST"))
    .to("http4://127.0.0.1");

The problem is that we do not want to hardcode the redelivery policies in
the route. Rather, I want to set them via the ProducerTemplate's
sendBodyAndHeader method. I have tried to set it up as an exchange header
but Camel does not like it:

 from("direct:HLTH.HttpOutbound")
      .errorHandler(defaultErrorHandler()
       
.maximumRedeliveries(Integer.parseInt(header("MaxRedeliveries").toString()))
        .redeliveryDelay(30000)
      .setHeader(Exchange.HTTP_URI, header("HTTP_URI"))
      .setHeader("CamelHttpMethod", constant("POST"))
    .to("http4://127.0.0.1");

I get a number format exception when starting up the route.

Any ideas on how to NOT hardcode the redelivery policies in the route
itself?




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-not-hardcode-MaxRedeliveries-in-a-route-tp5762577.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to