Re: How to return 429 Status Code instead of 503

2022-11-17 Thread Aleksandar Lazic
hi.

but there is a 429 error code in the source.

https://git.haproxy.org/?p=haproxy.git=search=HEAD=grep=HTTP_ERR_429

As you don't written which version you use, maybe you can use the latest 2.6 
version and give the error code 429 a chance :-)

regards
alex

17.11.2022 16:29:02 Chilaka Ramakrishna :

> Thanks Jarno, for the reply.
> 
> But i don't think this would work for me, I just want to change the status 
> code (return 429 instead of 503) that i can return, if queue timeout occurs 
> for a request..
> 
> Please confirm, if this is possible or this sort of provision is even exposed 
> by HAP.
> 
> On Thu, Nov 17, 2022 at 12:43 PM Jarno Huuskonen  
> wrote:
>> Hello,
>> 
>> On Tue, 2022-11-08 at 09:30 +0530, Chilaka Ramakrishna wrote:
>>> On queue timeout, currently HAProxy throws 503, But i want to return 429,
>>> I understand that 4xx means a client problem and client can't help here.
>>> But due to back compatibility reasons, I want to return 429 instead of
>>> 503. Is this possible ?
>> 
>> errorfile 503 /path/to/429.http
>> (http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#4-errorfile)
>> 
>> Or maybe it's possible with http-error
>> (http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#http-error)
>> 
>> -Jarno
>> 



Re: How to return 429 Status Code instead of 503

2022-11-17 Thread Chilaka Ramakrishna
Thanks Jarno, for the reply.

But i don't think this would work for me, I just want to change the status
code (return 429 instead of 503) that i can return, if queue timeout occurs
for a request..

Please confirm, if this is possible or this sort of provision is even
exposed by HAP.

On Thu, Nov 17, 2022 at 12:43 PM Jarno Huuskonen 
wrote:

> Hello,
>
> On Tue, 2022-11-08 at 09:30 +0530, Chilaka Ramakrishna wrote:
> > On queue timeout, currently HAProxy throws 503, But i want to return 429,
> > I understand that 4xx means a client problem and client can't help here.
> > But due to back compatibility reasons, I want to return 429 instead of
> > 503. Is this possible ?
>
> errorfile 503 /path/to/429.http
> (http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#4-errorfile)
>
> Or maybe it's possible with http-error
> (http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#http-error)
>
> -Jarno
>
> --
> Jarno Huuskonen
>


Re: How to return 429 Status Code instead of 503

2022-11-17 Thread Christopher Faulet

Le 11/17/22 à 08:13, Jarno Huuskonen a écrit :

Hello,

On Tue, 2022-11-08 at 09:30 +0530, Chilaka Ramakrishna wrote:

On queue timeout, currently HAProxy throws 503, But i want to return 429,
I understand that 4xx means a client problem and client can't help here.
But due to back compatibility reasons, I want to return 429 instead of
503. Is this possible ?


errorfile 503 /path/to/429.http
(http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#4-errorfile)

Or maybe it's possible with http-error
(http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#http-error)



This will work, but all errors generating 503 responses will be replaced by 429 
responses. For now, there is no way to make difference between a queue timeout 
and connection error for instance.


--
Christopher Faulet




Re: How to return 429 Status Code instead of 503

2022-11-16 Thread Jarno Huuskonen
Hello,

On Tue, 2022-11-08 at 09:30 +0530, Chilaka Ramakrishna wrote:
> On queue timeout, currently HAProxy throws 503, But i want to return 429,
> I understand that 4xx means a client problem and client can't help here.
> But due to back compatibility reasons, I want to return 429 instead of
> 503. Is this possible ?

errorfile 503 /path/to/429.http 
(http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#4-errorfile)

Or maybe it's possible with http-error
(http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#http-error)

-Jarno

-- 
Jarno Huuskonen


How to return 429 Status Code instead of 503

2022-11-07 Thread Chilaka Ramakrishna
Hi,

On queue timeout, currently HAProxy throws 503, But i want to return 429, I
understand that 4xx means a client problem and client can't help here. But
due to back compatibility reasons, I want to return 429 instead of 503. Is
this possible ?

Thanks,
Rama