Error Handling
Summary: Configuration of IM error handling -- retry policies, exponential backoff, error email notifications, and error message aggregation.
Configuration
Default Error Handler Properties
|
Property |
Default |
Description |
|---|---|---|
|
|
|
Whether the |
|
|
|
Maximum redelivery attempts. Negative value = retry forever |
|
|
|
Initial redelivery delay in milliseconds |
|
|
|
Maximum redelivery delay in ms |
|
|
|
Enable exponential backoff |
|
|
|
Multiplier for delay between redeliveries |
|
|
|
Log errors even if handled |
|
|
|
Whether to log retry attempts |
|
|
|
Whether to log stack traces |
Retryable Exceptions and HTTP Status Codes
|
Property |
Default |
Description |
|---|---|---|
|
|
|
Exceptions to retry |
|
|
|
HTTP status codes to retry |
|
|
|
If |
Email Notification Properties
|
Property |
Default |
Description |
|---|---|---|
|
|
|
Enable error email notifications |
|
|
|
SMTP hostname |
|
|
|
SMTP port |
|
|
|
Email sender address |
|
|
|
Email recipients (semicolon-separated) |
|
|
|
Velocity template for error email body |
Error Message Aggregation
|
Property |
Default |
Description |
|---|---|---|
|
|
|
Enable error message aggregation |
|
|
|
Check period (seconds) |
|
|
|
Error similarity threshold (1.0 = exact match) |
Understanding Retry Behavior
Which Errors Are Retried?
By default, IM retries these exception types:
-
RecoverableException-- transient Pricefx API errors -
ConnectTimeoutException-- network timeout connecting to host -
ConnectException-- connection refused
And these HTTP status codes:
-
409-- Conflict (concurrent load/flush in progress) -
503-- Service Unavailable (server temporarily down) -
504-- Gateway Timeout
All other errors fail immediately without retry.
Retry Timeline Example
With default settings (10 retries, 2s initial delay, 2.0 multiplier, 300s max):
|
Attempt |
Delay |
Cumulative |
|---|---|---|
|
1 |
2s |
2s |
|
2 |
4s |
6s |
|
3 |
8s |
14s |
|
4 |
16s |
30s |
|
5 |
32s |
62s |
|
6 |
64s |
~2 min |
|
7 |
128s |
~4 min |
|
8 |
256s |
~8 min |
|
9 |
300s (max) |
~13 min |
|
10 |
300s (max) |
~18 min |
Retry vs. Fail Fast
|
Scenario |
Recommendation |
|---|---|
|
|
Retry -- transient network issue |
|
|
Retry -- another operation in progress |
|
|
Retry -- server restarting |
|
|
Do not retry -- fix the request |
|
|
Do not retry -- fix credentials |
|
|
Do not retry -- fix configuration |
|
|
Do not retry -- fix the source data |
Route-Level Error Handling
onCompletion for Cleanup
<route id="import-with-cleanup">
<from uri="file:..."/>
<to uri="pfx-api:loaddata?objectType=P&mapper=myMapper"/>
<onCompletion onCompleteOnly="true">
<log message="Import succeeded"/>
</onCompletion>
<onCompletion onFailureOnly="true">
<log message="Import failed: ${exception.message}" loggingLevel="ERROR"/>
</onCompletion>
</route>
doTry / doCatch for Specific Error Handling
<route id="import-with-catch">
<from uri="file:..."/>
<doTry>
<to uri="pfx-api:loaddata?objectType=P&mapper=myMapper"/>
<doCatch>
<exception>java.net.ConnectException</exception>
<log message="Connection failed, will retry later" loggingLevel="WARN"/>
</doCatch>
<doCatch>
<exception>java.lang.IllegalStateException</exception>
<log message="Configuration error: ${exception.message}" loggingLevel="ERROR"/>
</doCatch>
</doTry>
</route>
Convention for Email Configuration
-
PROD partitions:
mailTo=<IE email>;integration@pricefx.eu -
QA/DEV partitions:
mailTo=<IE email> -
mailFrom convention:
integration_<pfx.partition>@pricefx.eu
See Also
-
Troubleshooting -- common runtime errors and solutions
-
Debugging -- debug logging and exchange inspection
-
Properties -- all
integration.route-error-handling.*properties