You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Minh Tran <da...@gmail.com> on 2014/12/08 01:19:57 UTC

clearing headers causes infinite redelivery

Hi

I've run into an issue where my route clears the headers right before a rest call to prevent unintended headers being sent on the request. Something like this.

<removeHeaders pattern="*""/>
<to uri="http4:blah"/>


Unfortunately this seems to wipe out the CamelRedeliveryCounter as well. So when an error occurs, redelivery just continues forever. I had to exclude Camel* headers to prevent this from happening.

Was there any reason why this wasn't put into properties instead or at least there should be a warning on the removeHeaders documentation that to remove all headers would mess up redelivery attempts.

Re: clearing headers causes infinite redelivery

Posted by Willem Jiang <wi...@gmail.com>.
If you don’t want to expose some camel header as the Http header, you can do it with camel header filter[1][2], in this way, you application logic cannot affect the camel internal logic.

[1]http://camel.apache.org/maven/camel-2.14.0/camel-core/apidocs/org/apache/camel/spi/HeaderFilterStrategy.html
[2]http://camel.apache.org/how-to-avoid-sending-some-or-all-message-headers.html


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On December 8, 2014 at 8:22:04 AM, Minh Tran (darth.minhster@gmail.com) wrote:
> Hi
>  
> I've run into an issue where my route clears the headers right before a rest call to prevent  
> unintended headers being sent on the request. Something like this.
>  
>  
>  
>  
>  
> Unfortunately this seems to wipe out the CamelRedeliveryCounter as well. So when an  
> error occurs, redelivery just continues forever. I had to exclude Camel* headers to  
> prevent this from happening.
>  
> Was there any reason why this wasn't put into properties instead or at least there should  
> be a warning on the removeHeaders documentation that to remove all headers would mess  
> up redelivery attempts.


Re: clearing headers causes infinite redelivery

Posted by Minh Tran <da...@gmail.com>.
2.14.0

I looked at what Willem suggested with the HeaderFilterStrategy but it seems a little cumbersome. Easier just to set the exclude pattern. 

On 08/12/2014, at 11:25 PM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
> 
> What version of Camel do you use?
> 
> On Mon, Dec 8, 2014 at 1:19 AM, Minh Tran <da...@gmail.com> wrote:
>> Hi
>> 
>> I've run into an issue where my route clears the headers right before a rest call to prevent unintended headers being sent on the request. Something like this.
>> 
>> <removeHeaders pattern="*""/>
>> <to uri="http4:blah"/>
>> 
>> 
>> Unfortunately this seems to wipe out the CamelRedeliveryCounter as well. So when an error occurs, redelivery just continues forever. I had to exclude Camel* headers to prevent this from happening.
>> 
>> Was there any reason why this wasn't put into properties instead or at least there should be a warning on the removeHeaders documentation that to remove all headers would mess up redelivery attempts.
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@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/


Re: clearing headers causes infinite redelivery

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

What version of Camel do you use?

On Mon, Dec 8, 2014 at 1:19 AM, Minh Tran <da...@gmail.com> wrote:
> Hi
>
> I've run into an issue where my route clears the headers right before a rest call to prevent unintended headers being sent on the request. Something like this.
>
> <removeHeaders pattern="*""/>
> <to uri="http4:blah"/>
>
>
> Unfortunately this seems to wipe out the CamelRedeliveryCounter as well. So when an error occurs, redelivery just continues forever. I had to exclude Camel* headers to prevent this from happening.
>
> Was there any reason why this wasn't put into properties instead or at least there should be a warning on the removeHeaders documentation that to remove all headers would mess up redelivery attempts.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@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/