You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Ron Barber <rb...@yahoo-inc.com> on 2013/11/25 20:18:10 UTC

RFC: Per remap custom errors

Hi TS community!

I am requesting comment/suggestions related to implementation of a feature that provides custom error responses on a per-remap basis.  Essentially, this is similar to the existing body factory but with support for external objects (via HTTP) AND definable on a per-remap basis.

I am thinking of moving forward in one of two directions for the implementation:
1.  Create a plugin which is independent of the existing body factory that implements the requirements.
2.  Extend the existing body factory to allow it to fetch external objects AND use conf_remap (or maybe extend it also) to swap out body factory configs on a per remap basis.

I'm hoping to get some opinions on which direction to go with this (or other suggestions ;).  Personally, #1 is much more comfortable to me because I have no idea about the existing body factory's implementation.  It seems like #2 would be more 'correct' as I think many would use this feature, but there may be limitations on API usage for core functionality which I am unaware of..

Requirements: https://cwiki.apache.org/confluence/display/TS/Per+Remap+Custom+Errors

I appreciate any (helpful) thoughts.

-Ron Barber

Re: RFC: Per remap custom errors

Posted by Ron Barber <rb...@yahoo-inc.com>.
Thanks for responding while you are on vacation.

Mr. Peach and I had an IRC discussion and he has a need for a plugin (he
called 'escalation' plugin) which is similar in that if a specified error
is returned the request should be forwarded to another location.  I have
floated that idea here as an alternate to the custom error plugin and,
although I have received little response due to vacations, no one has said
no so far.  At this point I am moving forward with the escalation plugin
ideaŠwill write something up next week similar to the custom error plugin
and post that for comment.

Thank you,
Ron 

On 11/26/13 2:07 PM, "Leif Hedstrom" <zw...@apache.org> wrote:

>On Nov 25, 2013, at 11:18 AM, Ron Barber <rb...@yahoo-inc.com> wrote:
>
>> Hi TS community!
>> 
>> I am requesting comment/suggestions related to implementation of a
>>feature that provides custom error responses on a per-remap basis.
>>Essentially, this is similar to the existing body factory but with
>>support for external objects (via HTTP) AND definable on a per-remap
>>basis.
>> 
>> I am thinking of moving forward in one of two directions for the
>>implementation:
>> 1.  Create a plugin which is independent of the existing body factory
>>that implements the requirements.
>> 2.  Extend the existing body factory to allow it to fetch external
>>objects AND use conf_remap (or maybe extend it also) to swap out body
>>factory configs on a per remap basis.
>
>
>I need to think about this a little more, but I think a combo of both is
>the way to go; a new API which allows direct control of body factory
>negotiation. The reason I¹m thinking that is because the body factory was
>intended to support multiple ³factories² already (typically based on
>Accept-Language). The additional API allows you to control this from
>either existing plugins (e.g. regex_remap could support it), or create a
>generic ³body_factory² plugin. But the plugin would not have to implement
>a the body factory, just the negotiation portion.
>
>I¹m on vacation all week this week, so probably can¹t look at it for a
>little while. Anyone else got any clever thoughts on this?
>
>Cheers,
>
>‹ Leif


Re: RFC: Per remap custom errors

Posted by Leif Hedstrom <zw...@apache.org>.
On Nov 25, 2013, at 11:18 AM, Ron Barber <rb...@yahoo-inc.com> wrote:

> Hi TS community!
> 
> I am requesting comment/suggestions related to implementation of a feature that provides custom error responses on a per-remap basis.  Essentially, this is similar to the existing body factory but with support for external objects (via HTTP) AND definable on a per-remap basis.
> 
> I am thinking of moving forward in one of two directions for the implementation:
> 1.  Create a plugin which is independent of the existing body factory that implements the requirements.
> 2.  Extend the existing body factory to allow it to fetch external objects AND use conf_remap (or maybe extend it also) to swap out body factory configs on a per remap basis.


I need to think about this a little more, but I think a combo of both is the way to go; a new API which allows direct control of body factory negotiation. The reason I’m thinking that is because the body factory was intended to support multiple “factories” already (typically based on Accept-Language). The additional API allows you to control this from either existing plugins (e.g. regex_remap could support it), or create a generic “body_factory” plugin. But the plugin would not have to implement a the body factory, just the negotiation portion.

I’m on vacation all week this week, so probably can’t look at it for a little while. Anyone else got any clever thoughts on this?

Cheers,

— Leif