[Apiman-user] Unable to get Simple Header Policy response when Rate Limiting Policy fails

Marc Savy marc.savy at redhat.com
Thu Jan 12 09:05:48 EST 2017


This is an interesting use-case. In short, it is not possible with the
standard apiman workflow, but is still achievable (although the granularity
may not be satisfactory). This is because failures and errors return
immediately - which has always been the desired behaviour up until now.

I don't know what the specifics of your usage are, but, broadly:

Options:

1. Modify your Undertow subsystem config to add the header to all responses
(in standalone.xml).

See:
https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/7.0/paged/configuration-guide/chapter-17-configuring-the-web-server-undertow

Example:

   <filters>
<response-header name="server-header" header-name="Server"
header-value="WildFly/10/apiman"/>
   </filters>

2. Provide your own implementations of IPolicyFailureWriter and/or
IPolicyErrorWriter.

In your apiman config:

apiman-gateway.writers.policy-failure=<your impl>
apiman-gateway.writers.error=<your impl>

It may be that you only want to do one, or both.

On 12 January 2017 at 09:25, <Ram.Tanna at ril.com> wrote:

> Hi Guys,
>
>
>
> I have added *Simple Header Policy* and *Rate Limiting Policy* on my API.
>
>
>
> I want my custom response header(defined in simple header policy) in all
> the responses.
>
>
>
> I am getting custom header when the response is 200. But as my Rate limit
> exceeds I receive 429 status code and custom response doesn´t appear.
>
>
>
> I want Custom Response Header in all the scenarios (whether its 200 or
> 429).
>
>
>
> Can you please help me in achieving it ?
>
>
>
> Thanks and Regards,
>
> Ram Tanna
>
>
> "*Confidentiality Warning*: This message and any attachments are intended
> only for the use of the intended recipient(s), are confidential and may be
> privileged. If you are not the intended recipient, you are hereby notified
> that any review, re-transmission, conversion to hard copy, copying,
> circulation or other use of this message and any attachments is strictly
> prohibited. If you are not the intended recipient, please notify the sender
> immediately by return email and delete this message and any attachments
> from your system.
>
> *Virus Warning:* Although the company has taken reasonable precautions to
> ensure no viruses are present in this email. The company cannot accept
> responsibility for any loss or damage arising from the use of this email or
> attachment."
>
> _______________________________________________
> Apiman-user mailing list
> Apiman-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/apiman-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20170112/21e4b0d9/attachment.html 


More information about the Apiman-user mailing list