Java 4.9.0 default policy not working as documented

Description

I have a user following the below documentatation:

https://docs.datastax.com/en/developer/java-driver/4.9/manual/core/load_balancing/#default-policy

The user has been providing the local datacenter name programmatically as per above, but does not appear to work and reports the below example error:

ONLY if we add the below to the application.conf file and compile it appears to work.

Below you will find a testcase that you can easily re-produce the above behaviour.

Can someone please review the above and confirm if this is a product issue?

Thanks

Environment

None

Pull Requests

None

Activity

Show:
Alexandre Dutra
November 5, 2020, 2:41 PM

As the javadocs of SessionBuilder.withLocalDatacenter(String) CLEARLY STATE, this method is an “Alias to withLocalDatacenter(String, String) for the default profile”.

If you define other profiles, you need to set the local datacenter for them as well, by calling withLocalDatacenter(String,String) for each profile:

I opened a PR with a fix for the sample app you provided. It works well on my machine with 2 local cluster of 1 node each, and distinct datacenters.

Federico Romano
December 7, 2020, 5:32 PM

apologies for the delayed response. I just wanted to close off this loop and say THANK you for your great help as I received confirmation from the user that the support case can be closed after sharing your above fix.

Assignee

Unassigned

Reporter

Federico Romano

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

None

Fix versions

None

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Major
Configure