Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-3111

Java SDK delay examples with wrong code

    XMLWordPrintable

Details

    Description

      Public documentation about retry strategies from Java SDK:

      https://developer.couchbase.com/documentation/server/current/sdk/java/handling-error-conditions.html#story-h2-12 

      Has wrong example Java code:

       

      Functionality like this is a great candidate to be generic and encapsulated, so that's what we did with RetryBuilder. If you are already using Java 8, the code becomes more condensed as well:

      SAMPLE_CODE

      Here are the variations for linear, exponential and random delays:

      Linear:

      SAME_SAMPLE_CODE

      Exponential:

      SAME_SAMPLE_CODE

      Random:

      SAME_SAMPLE_CODE

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard.smedley Richard Smedley
            manuel.hurtado Manuel Hurtado (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty