Data Hub Adapter Connection Retry

Data Hub Adapter attempts to reconnect to Data Hub when experiencing a loss of network connection. Reconnection helps prevent manually retriggering failed calls to Data Hub from SAP Commerce Cloud.

If a connection fails, Data Hub Adapter retries the connection at configurable intervals, up to a maximum number of retry attempts. After each retry attempt, the wait time before the next attempt is lengthened by a configurable multiplier, up to a configurable limit. Once the maximum number of retry attempts has been reached for a particular connection, no further connection attempts are made.

Configuring Failover Behavior

The following are the default values for each configuration property. You can provide different values by adding these properties to the local.properties file of your SAP Commerce Cloud installation. Typically, the local.properties file is located in the <HYBRIS_HOME>/config/ directory.

# The initial sleep interval in milliseconds
datahubadapter.retry.initial.interval.millis=1000
# The value to increment the exponential seed with for each retry attempt.
# Hint: do not use values much in excess of 2.0 (or the wait time becomes very long very fast).
datahubadapter.retry.multiplier=2
# The maximum number of attempts
datahubadapter.retry.max.attempts=5
# The maximum value of the wait time in milliseconds.
datahubadapter.retry.max.interval.millis=256000

A multiplier set to 2 doubles the wait time before each subsequent attempt. The wait time does not exceed the datahubadapter.retry.max.interval.millis, even if a large multiplier value is set. Log output for a failing connection with a multiplier of 2 would appear with WARN, as follows:

WARN  [hybrisHTTP1] [ImpexDataImportClient] Data Hub Server is unavailable.  The Data Hub Adapter tries again in 1 second for retry attempt 1 of 10.
WARN  [hybrisHTTP1] [ImpexDataImportClient] java.net.ConnectException: Connection refused: connect
WARN  [hybrisHTTP1] [ImpexDataImportClient] Data Hub Server is unavailable.  The Data Hub Adapter tries again in 2 seconds for retry attempt 2 of 10.
WARN  [hybrisHTTP1] [ImpexDataImportClient] java.net.ConnectException: Connection refused: connect
WARN  [hybrisHTTP1] [ImpexDataImportClient] Data Hub Server is unavailable.  The Data Hub Adapter tries again in 4 seconds for retry attempt 3 of 10.
WARN  [hybrisHTTP1] [ImpexDataImportClient] java.net.ConnectException: Connection refused: connect

If a new connection is initiated after a previous attempt fails, the retry process starts again. The retry applies to both new connections with new data, and new connections with the same data. If the adapter fails to make a connection after the final retry attempt, you see the following ERROR in your SAP Commerce Cloud logs:

ERROR [hybrisHTTP1] [ImpexDataImportClient] java.net.ConnectException: Connection refused: connect

The error message is followed by a stacktrace, which allows you to dig further down to the root cause of the connection issue.

To disable the retry feature entirely and attempt the connection only once, set datahubadapter.retry.max.attempts to 1 (one).