[
https://issues.apache.org/jira/browse/CXF-8288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17550884#comment-17550884
]
Konrad Windszus edited comment on CXF-8288 at 6/7/22 8:56 AM:
--------------------------------------------------------------
The problem is that {{org.apache.cxf.clustering.FailoverStrategy}}
implementations are only getting called once with
{{getAlternateAddresses/getAlternateEndpoints}} which get the current message
exchange as parameter. For a consecutive error (even if happening on the same
address/endpoint) only {{selectAlternateAddress/selectAlternateEndpoint}} is
called, which doesn't carry any information about the last (failed) request.
That makes it impossible to handle two consecutive 429 responses in the
{{RetryStrategy}} correctly, as for the second response you don't have access
to any of the response headers.
was (Author: kwin):
The problem is that {{org.apache.cxf.clustering.FailoverStrategy}}
implementations are only getting asked called once with
{{getAlternateAddresses/getAlternateEndpoints}} which get the current message
exchange as parameter. For a consecutive error (even if happening on the same
address/endpoint) only {{selectAlternateAddress/selectAlternateEndpoint}} is
called, which doesn't carry any information about the last (failed) request.
That makes it impossible to handle two consecutive 429 responses in the
{{RetryStrategy}} correctly, as for the second response you don't have access
to any of the response headers.
> RetryStrategy: Evaluate Retry-After response header included in a 429 response
> ------------------------------------------------------------------------------
>
> Key: CXF-8288
> URL: https://issues.apache.org/jira/browse/CXF-8288
> Project: CXF
> Issue Type: Improvement
> Reporter: Konrad Windszus
> Assignee: Freeman Yue Fang
> Priority: Major
>
> Sometimes servers indicate how long to wait until a retry should be scheduled
> (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). The
> {{retry-after}} response header should be evaluated in case of a 429 response
> in
> https://github.com/apache/cxf/blob/540bb76f6f3d3d23944c566905f9f395c6f86b79/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java#L30
> to influence the delay
> (https://github.com/apache/cxf/blob/f1f312b6dcd3770a52d1dd42e260a4ac26c779b7/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java#L47).
--
This message was sent by Atlassian Jira
(v8.20.7#820007)