1

I'm using the datastax Java cassandra driver (3.0.2) to connect to a cassandra cluster. In case of a NoHostAvailableException i want to retry after some seconds. Is is correct, that none of the predefined policies covers this requirement? I think i have to implement a custom Policy:

public class CustomRetryPolicy implements RetryPolicy {...}
  • DefaultRetryPolicy

This implementation triggers a maximum of one retry, and only if enough replicas had responded to the read request but data was not retrieved amongst those.

  • DowngradingConsistencyRetryPolicy

A retry policy that sometimes retries with a lower consistency level than the one initially requested.

  • FallThroughRetryPolicy

A retry policy that never retries (nor ignores).

  • LoggingRetryPolicy

A retry policy that wraps another policy, logging the decision made by its sub-policy

itstata
  • 1,058
  • 7
  • 17
  • 1
    Sorry, but the linked answere did't answere the question if this retry policy for NoHostAvailableExeption is delivered by the java driver of datastax. – itstata Jan 18 '17 at 07:45
  • 1
    It doesn't make sense to retry on NoHostAvailableExeption, this exception is merely a container for a set of exceptions encountered when querying different hosts for one given request. The RetryPolicy applies to each one of these errors individually, not to NoHostAvailableExeption. – adutra Jan 18 '17 at 11:20

0 Answers0