Skip to content

Riak Java Client 2.0 FAQ

Alex Moore edited this page Feb 8, 2017 · 1 revision

Riak Java Client 2.0 Frequently Asked Questions

Protocol Support

Does Riak Java Client 2.0 support HTTP?

No. Version 2.0+ of the client only supports Riak's Protocol Buffers and Term-to-Binary encoding protocols.

Load Balancing

Can I connect the client to multiple Riak nodes?

Yes. To use it you can pass multiple node addresses to RiakClient and RiakCluster builders.

Does the client do any load balancing?

Yes, if provided multiple Riak nodes it will round-robin operations between them for load balancing and liveliness purposes.

How does the client test for node liveliness?

Each client RiakNode object runs a HealthMonitoring thread that keeps track of significant events. If a node's behavior meets any of the following criteria, the client will remove the node from the load balancer's rotation until it is deemed safe.

  • 5+ recently closed connections within 3 seconds
  • 2+ consecutive failed connections
  • 6+ consecutive failed operations

The node will be added back to the load balancer rotation when it passes a health check.

What health checks are available?

The default health check is a simple PingHealthCheck, which pings the server.

A StoreValueHealthCheck is also available, which will also test deeper into Riak, but at the expense of an additional operation on the database.

Users may also provide their own health check by implementing the HealthCheckFactory interface, and extending the HealthCheckDecoder class (see the StoreValueHealthCheck class for implementation details).