[id='configuring-hot-rod-clients-cross-site_{context}']
= Configuring Hot Rod clients for cross-site replication

Configure Hot Rod clients to use {brandname} clusters at different sites.

.hotrod-client.properties
[source,options="nowrap",subs=attributes+,role="primary"]
----
include::properties/hotrod-client-cross-site.properties[]
----

.ConfigurationBuilder
[source,java,options="nowrap",subs=attributes+,role="secondary"]
----
include::code_examples/CrossSiteAddClusters.java[]
----

[TIP]
====
Use the following methods to switch Hot Rod clients to the default cluster or to a cluster at a different site:

* `RemoteCacheManager.switchToDefaultCluster()`
* `RemoteCacheManager.switchToCluster(${site.name})`
====

[role="_additional-resources"]
.Additional resources
* link:{javadocroot}/org/infinispan/client/hotrod/configuration/package-summary.html#package.description[org.infinispan.client.hotrod.configuration package description]
* link:{javadocroot}/org/infinispan/client/hotrod/configuration/ConfigurationBuilder.html[org.infinispan.client.hotrod.configuration.ConfigurationBuilder]
* link:{javadocroot}/org/infinispan/client/hotrod/RemoteCacheManager.html#RemoteCacheManager-java.net.URL-[org.infinispan.client.hotrod.RemoteCacheManager]
