Hi

Use onRedelivery to implement logic whether to redeliver or not. Then
that logic can use headers and whatnot

On Wed, Feb 11, 2015 at 12:43 AM, arafiq <ara...@onenetwork.com> wrote:
> 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.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to