---
agentTools:
  projectIndex: https://resilience4j.readme.io/llms.txt
---

# Examples

Examples of resilience4j-retry

Fix typo

[block:api-header]
{
  "title": "Create a RetryRegistry"
}
[/block]

Create a RetryRegistry with a custom RetryConfig.

[block:code]
{
  "codes": [
    {
      "code": "RetryConfig config = RetryConfig.custom()\n    .maxAttempts(2)\n    .waitDuration(Duration.ofMillis(100))\n    .retryOnResult(response -> response.getStatus() == 500)\n    .retryOnException(e -> e instanceof WebServiceException)\n    .retryExceptions(IOException.class, TimeoutException.class)\n    .ignoreExceptions(BusinessException.class, OtherBusinessException.class)\n    .build();\n    \n// Create a RetryRegistry with a custom global configuration\nRetryRegistry registry = RetryRegistry.of(config);",
      "language": "java"
    }
  ]
}
[/block]