6.5.2. 热备份配置构建程序 OpenShift
配置为在 OpenShift 之外运行的 Hot Rod 客户端:
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
// Connection
.host("${HOTROD_ROUTE_HOSTNAME}").port(443)
// Use BASIC client intelligence.
.clientIntelligence(ClientIntelligence.BASIC)
.security()
// Authentication
.authentication().enable()
.username("${USERNAME}")
.password("${PASSWORD}")
.serverName("${APPLICATION_NAME}")
.saslMechanism("DIGEST-MD5")
.saslQop(SaslQop.AUTH)
// Encryption
.ssl()
.sniHostName("${HOTROD_ROUTE_HOSTNAME}")
.trustStorePath(path/to/tls.crt);
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
// Connection
.host("${HOTROD_ROUTE_HOSTNAME}").port(443)
// Use BASIC client intelligence.
.clientIntelligence(ClientIntelligence.BASIC)
.security()
// Authentication
.authentication().enable()
.username("${USERNAME}")
.password("${PASSWORD}")
.serverName("${APPLICATION_NAME}")
.saslMechanism("DIGEST-MD5")
.saslQop(SaslQop.AUTH)
// Encryption
.ssl()
.sniHostName("${HOTROD_ROUTE_HOSTNAME}")
.trustStorePath(path/to/tls.crt);