question

resolve123_170609 avatar image
resolve123_170609 asked Erick Ramirez answered

Why does the Java driver not retry with another node?

Hi I am using cassandra 3.11.11 and java driver 4.12 .Can some help me why my queries fails with connection closed error. Why my driver is not retrying with another node. I am using default policies. Is there any property i need to set for retry to another node and how many times to retry before thrwing the exception.

java driver
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

The Java driver uses a default retry policy out of the box:

datastax-java-driver {
  advanced.retry-policy {
    class = DefaultRetryPolicy
  }
}

It will only ever retry once because it doesn't make sense to keep retrying. An a query will only be retried if it is idempotent. For details on how it works, see Retries with the Java driver.

You haven't provided enough information in your post. Please update your question with relevant information to make it easy for us to help you. At the very least, please provide:

  • full error message + full stack trace
  • minimum amount of code that replicates the problem
  • sample query that is failing

Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.