Note that #2 is documented here:

http://www.apiman.io/latest/developer-guide.html#_providing_a_custom_policy_failure_error_writer

-Eric

On Thu, Jan 12, 2017 at 9:05 AM, Marc Savy <marc.savy@redhat.com> wrote:
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).  


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@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/apiman-user



_______________________________________________
Apiman-user mailing list
Apiman-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/apiman-user