Select search mode

 
50 of 122

Driver should automatically pickup contact points when Stargate is introduced to a cluster

Description

Driver should automatically pick up contact points when Stargate is introduced to a cluster. Without this automatic resolution, the client application must be restarted resulting in downtime.

Driver being used is 3.10.2.
Here are some examples of code being used to access the cluster:

session = CqlSession.builder() .withCloudSecureConnectBundle(Paths.get(bundle)) .withAuthCredentials(username, password) .withKeyspace(keyspace) .build(); private CqlSession createCloudCqlSession() { return standardCqlSessionBuilder() .withCloudSecureConnectBundle(Paths.get(path)).build(); } private com.datastax.oss.driver.api.core.CqlSessionBuilder standardCqlSessionBuilder() { return CqlSession.builder() .withKeyspace(keyspaceName) .addTypeCodecs( ExtraTypeCodecs.json(Rule.class, mapper), ExtraTypeCodecs.json(SegmentEntity.class, mapper), ExtraTypeCodecs.json(SegmentType.class, mapper), new EnumNameCodec<>(FilterType.class)) .withAuthCredentials(username, password); } Cluster.builder .withClusterName(s"${system.name}-${SecureBundleConfigSessionProvider.clusterIdentifier.getAndIncrement()}") .withCloudSecureConnectBundle(secureConnectBundle) .withPoolingOptions(poolingOptions) .withReconnectionPolicy(new ExponentialReconnectionPolicy(1000, reconnectMaxDelay.toMillis)) .withQueryOptions(new QueryOptions().setFetchSize(fetchSize)) .withLoadBalancingPolicy(new TokenAwarePolicy(DCAwareRoundRobinPolicy.builder.withLocalDc(localDatacenter) .withUsedHostsPerRemoteDc(usedHostsPerRemoteDc) .build()))

Environment

None

Pull Requests

None

Details

Assignee

Reporter

Affects versions

Priority

Created February 15, 2022 at 3:34 PM
Updated January 13, 2025 at 9:28 PM

Activity

Show: