Repository navigation
v4.9.0
·
56 commits
to master
since this release
- Requires at least ph-commons 12.6.0
- Updated to ph-web 11.5.0
- Updated to peppol-commons 13.2.2 - the HTTP
Retry-Afterresponse header of SMP lookups is now limited (default 30 seconds,SMPHttpClientSettings.setMaxRetryAfter).
If the SMP requests a longer waiting time, the lookup fails instead of blocking. - Reworked the HTTP retry handling of outgoing messages, to only retry if a retry is feasible.
See #416
The guiding question is whether the request could have reached the server.
The new classHttpRetryClassifierwith the enumEHttpRetryClassificationcontains the decision logic.- Retried for any request (the request was never sent): connection refused, connect timeout, connection request timeout, no route to host and unknown host (by default only 1 retry, see
HttpRetrySettings.setMaxRetriesUnknownHost(int)) - Retried only if replaying is safe:
NoHttpResponseException, read timeout, closed or reset connections and all otherIOExceptions - Never retried: SSL/TLS errors, HTTP protocol errors (including redirect errors), interrupted or aborted requests
- HTTP status codes
408,425,429and503are always retried,500,502and504only if replaying is safe, all others never.
This is independent of the configuration propertyphase4.http.response.accept.allstatuscodes.
Until now, with the default configuration, no retry happened based on the HTTP status code at all.
On the last try, such a response is handled as before.
- Retried for any request (the request was never sent): connection refused, connect timeout, connection request timeout, no route to host and unknown host (by default only 1 retry, see
- Added the new property
HttpRetrySettings.replaySafe(defaulttrue), because AS4 receivers detect duplicates based on the message ID. - The HTTP response header
Retry-Afteris now honoured (in seconds or as an HTTP date), if it is longer than the computed waiting time.
If it exceedsHttpRetrySettings.maxRetryAfter(default 5 minutes), no retry happens. - Added the new property
HttpRetrySettings.jitterFactor(default0= no jitter) to randomly change the waiting time before a retry by up to the provided factor. - Added the new property
HttpRetrySettings.maxDurationBeforeRetry(default 5 minutes) to limit the increase of the waiting time viaretryIncreaseFactor.
The jitter is applied on top of the limited waiting time. - The
retryIncreaseFactorofHttpRetrySettingsis now already applied to the second retry, as documented.
Until now it was only applied from the third retry on. - A received SOAP Fault with a
PERMANENTdisposition is never retried, also ifphase4.http.response.accept.allstatuscodesis enabled (the default) and the HTTP status code would allow a retry.
The sending terminates regularly in that case.
For this, the new classHttpRetryVetoallows an HTTP response handler to veto the retry of the response it is handling. - A received SOAP Fault with a
TRANSIENTdisposition is retried according to the HTTP status code of the response, independent ofphase4.http.response.accept.allstatuscodes. - Waiting before a retry can now be interrupted, which stops all retries.
- The HTTP response headers of
AS4ClientSentMessagenow only contain the headers of the last try.
Until now the headers of all tries were accumulated. - A SOAP Fault received on a previous try is no longer reported, if the last try succeeded without a SOAP Fault.
- Disabled the automatic retries of Apache HttpClient for all phase4 specific
HttpClientSettingsimplementations, forBasicHttpPoster.createDefaultHttpClientFactory()and for the default of all message builders, because retries are handled on the phase4-level.
The only exception isPhase4PeppolCRLHttpClientSettings, which keeps the automatic retries, because CRL downloads are not retried on the phase4-level.
Until now Apache HttpClient additionally retried once for the HTTP status codes429and503, waiting for anyRetry-Afterduration without a limit.
This requires ph-web 11.5.0 or later (HttpClientSettings.setDisableAutomaticRetries(boolean)). - Fixed the retry feasibility of failed SMP lookups (
Phase4SMPException.isRetryFeasible()and thereforeEAS4UserMessageSendResult.TRANSPORT_ERRORvs.TRANSPORT_ERROR_NO_RETRY) for the Peppol, BDXR and BDXR2 endpoint detail providers.
Since peppol-commons 12.8.0 the classification was largely inverted: an unreachable SMP and HTTP 5xx responses were reported as "no retry", while HTTP 400 and 403 responses, an HTTP 404 response and a non-matching endpoint were reported as "retry feasible".
The new classSMPRetryClassifiernow decides: an unreachable SMP (unknown host, connection refused, timeout) can be retried, HTTP error responses are decided by their status code like the AS4 transmission, invalid SMP responses (e.g. invalid signature) and missing endpoints are not retried. - The configuration property
phase4.http.response.accept.allstatuscodesis planned to be removed in v5, so that all HTTP status codes are always accepted.
Full Changelog: phase4-parent-pom-4.8.4...phase4-parent-pom-4.9.0