Class ClusterBatchOptions

    • Method Detail

      • getRoute

        public RequestRoutingConfiguration.SingleNodeRoute getRoute()
        Configures single-node routing for the batch request. The client will send the batch to the specified node defined by route.

        If a redirection error occurs:

        • For Atomic Batches (Transactions), the entire transaction will be redirected.
        • For Non-Atomic Batches (Pipelines), only the commands that encountered redirection errors will be redirected.
      • getRetryStrategy

        public ClusterBatchRetryStrategy getRetryStrategy()
        ⚠️ Please see ClusterBatchRetryStrategy and read carefully before enabling these options.

        Defines the retry strategy for handling cluster batch request failures.

        This strategy determines whether failed commands should be retried, potentially impacting execution order.

        • If retryServerError is true, retriable errors (e.g., TRYAGAIN) will trigger a retry.
        • If retryConnectionError is true, connection failures will trigger a retry.

        Warnings:

        • Retrying server errors may cause commands targeting the same slot to execute out of order.
        • Retrying connection errors may lead to duplicate executions, as it is unclear which commands have already been processed.

        Note: Currently, retry strategies are supported only for non-atomic batches.

        Recommendation: It is recommended to increase the timeout in BaseBatchOptions#timeout when enabling these strategies.

        Default: Both retryServerError and retryConnectionError are set to false.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object