<div dir="ltr">Note that #2 is documented here:<div><br></div><div><a href="http://www.apiman.io/latest/developer-guide.html#_providing_a_custom_policy_failure_error_writer">http://www.apiman.io/latest/developer-guide.html#_providing_a_custom_policy_failure_error_writer</a><br></div><div><br></div><div>-Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 12, 2017 at 9:05 AM, Marc Savy <span dir="ltr">&lt;<a href="mailto:marc.savy@redhat.com" target="_blank">marc.savy@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font face="arial, helvetica, sans-serif">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. </font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I don&#39;t know what the specifics of your usage are, but, broadly:<br></font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Options:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">1. Modify your Undertow subsystem config to add the header to all responses (in standalone.xml).  </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-tag" style="font-size:13px;box-sizing:border-box;color:rgb(220,103,94)"><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)"><font face="arial, helvetica, sans-serif">See: <a href="https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/7.0/paged/configuration-guide/chapter-17-configuring-the-web-server-undertow" target="_blank">https://access.redhat.<wbr>com/documentation/en/red-hat-<wbr>jboss-enterprise-application-<wbr>platform/7.0/paged/<wbr>configuration-guide/chapter-<wbr>17-configuring-the-web-server-<wbr>undertow</a></font></span></span></div><div><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-tag" style="font-size:13px;box-sizing:border-box;color:rgb(220,103,94)"><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)"><font face="arial, helvetica, sans-serif"><br></font></span></span></div><div><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-tag" style="font-size:13px;box-sizing:border-box;color:rgb(220,103,94)"><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)"><font face="arial, helvetica, sans-serif">Example:</font></span></span></div><div><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-tag" style="font-size:13px;box-sizing:border-box;color:rgb(220,103,94)"><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)"><font face="arial, helvetica, sans-serif"><br></font></span></span></div><div><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-tag" style="box-sizing:border-box"><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-punctuation" style="box-sizing:border-box"><font face="monospace, monospace"><div><span class="m_-3932799588816305574gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>    &lt;filters&gt;</div><div><span class="m_-3932799588816305574gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>&lt;response-header name=&quot;server-header&quot; header-name=&quot;Server&quot; header-value=&quot;WildFly/10/<wbr>apiman&quot;/&gt;</div><div><span class="m_-3932799588816305574gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>    &lt;/filters&gt;</div></font></span></span></div><div><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-tag" style="font-size:13px;box-sizing:border-box;color:rgb(220,103,94)"><span class="m_-3932799588816305574gmail-token m_-3932799588816305574gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)"><font face="arial, helvetica, sans-serif"><br></font></span></span></div><div><font face="arial, helvetica, sans-serif">2. Provide your own implementations of IPolicyFailureWriter and/or IPolicyErrorWriter.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">In your apiman config:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">apiman-gateway.writers.policy-<wbr>failure=&lt;your impl&gt;<br></font></div><div><div><font face="arial, helvetica, sans-serif">apiman-gateway.writers.error=&lt;<wbr>your impl&gt;</font></div></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">It may be that you only want to do one, or both.</font></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 12 January 2017 at 09:25,  <span dir="ltr">&lt;<a href="mailto:Ram.Tanna@ril.com" target="_blank">Ram.Tanna@ril.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">





<div lang="EN-IN" link="#0563C1" vlink="#954F72">
<div class="m_-3932799588816305574m_-38390027028267351WordSection1">
<p class="MsoNormal">Hi Guys, <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have added <b>Simple Header Policy</b> and <b>Rate Limiting Policy</b> on my API.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I want my custom response header(defined in simple header policy) in all the responses.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I want Custom Response Header in all the scenarios (whether its 200 or 429).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Can you please help me in achieving it ? <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks and Regards,<u></u><u></u></p>
<p class="MsoNormal">Ram Tanna<u></u><u></u></p>
</div>
<p><br><span style="text-decoration:none">&quot;<strong><span style="text-decoration:underline">Confidentiality Warning</span></strong></span>: 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.</p>
<p><strong><span style="text-decoration:underline">Virus Warning:</span></strong> 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.&quot;</p></div>

<br></div></div>______________________________<wbr>_________________<br>
Apiman-user mailing list<br>
<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/apiman-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/apiman-user</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Apiman-user mailing list<br>
<a href="mailto:Apiman-user@lists.jboss.org">Apiman-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/apiman-user" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/apiman-user</a><br>
<br></blockquote></div><br></div>