Skip to content

v4.9.0

Choose a tag to compare

@phax phax released this 11 Nov 17:50
· 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-After response 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 class HttpRetryClassifier with the enum EHttpRetryClassification contains 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 other IOExceptions
    • Never retried: SSL/TLS errors, HTTP protocol errors (including redirect errors), interrupted or aborted requests
    • HTTP status codes 408, 425, 429 and 503 are always retried, 500, 502 and 504 only if replaying is safe, all others never.
      This is independent of the configuration property phase4.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.
  • Added the new property HttpRetrySettings.replaySafe (default true), because AS4 receivers detect duplicates based on the message ID.
  • The HTTP response header Retry-After is now honoured (in seconds or as an HTTP date), if it is longer than the computed waiting time.
    If it exceeds HttpRetrySettings.maxRetryAfter (default 5 minutes), no retry happens.
  • Added the new property HttpRetrySettings.jitterFactor (default 0 = 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 via retryIncreaseFactor.
    The jitter is applied on top of the limited waiting time.
  • The retryIncreaseFactor of HttpRetrySettings is 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 PERMANENT disposition is never retried, also if phase4.http.response.accept.allstatuscodes is enabled (the default) and the HTTP status code would allow a retry.
    The sending terminates regularly in that case.
    For this, the new class HttpRetryVeto allows an HTTP response handler to veto the retry of the response it is handling.
  • A received SOAP Fault with a TRANSIENT disposition is retried according to the HTTP status code of the response, independent of phase4.http.response.accept.allstatuscodes.
  • Waiting before a retry can now be interrupted, which stops all retries.
  • The HTTP response headers of AS4ClientSentMessage now 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 HttpClientSettings implementations, for BasicHttpPoster.createDefaultHttpClientFactory() and for the default of all message builders, because retries are handled on the phase4-level.
    The only exception is Phase4PeppolCRLHttpClientSettings, 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 codes 429 and 503, waiting for any Retry-After duration 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 therefore EAS4UserMessageSendResult.TRANSPORT_ERROR vs. 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 class SMPRetryClassifier now 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.allstatuscodes is 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