From 27cf40fdd205b7d0c7f079fab7651b24e92bd8a1 Mon Sep 17 00:00:00 2001 From: Jonathan Halterman Date: Thu, 5 Feb 2015 16:37:28 -0800 Subject: [PATCH] Better recovery strategy in the README for folks who use this --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 28fb332..62c3ad6 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,7 @@ To start, create a `Config` object, specifying a recovery policy: ```java Config config = new Config() - .withRecoveryPolicy(new RecoveryPolicy() - .withMaxAttempts(20) - .withInterval(Duration.seconds(1)) - .withMaxDuration(Duration.minutes(5))); + .withRecoveryPolicy(new RecoveryPolicy().withBackoff(Duration.seconds(1), Duration.seconds(30)) ``` With our `config`, let's create some *recoverable* resources: @@ -75,8 +72,9 @@ Lyra also supports invocation retries when a *retryable* failure occurs while cr Config config = new Config() .withRecoveryPolicy(RecoveryPolicies.recoverAlways()) .withRetryPolicy(new RetryPolicy() - .withBackoff(Duration.seconds(1), Duration.seconds(30)) - .withMaxDuration(Duration.minutes(10))); + .withMaxAttempts(20) + .withInterval(Duration.seconds(1)) + .withMaxDuration(Duration.minutes(5))); ConnectionOptions options = new ConnectionOptions().withHost("localhost"); Connection connection = Connections.create(options, config);