-
Type: New Feature
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Cluster Management, Configuration
-
None
-
Fully Compatible
Current Situation
The predefined ReadPreferences in TaggableReadPreference (NearestReadPreference, SecondaryPreferredReadPreference, SecondaryReadPreference) are package protected.
A developer wanting to create a new ReadPreference cannot easily extend from one of the already available ones, and it has to, either duplicate code, or to create the new ReadPreference in a com.mongodb package.
Desired Behaviour
If the predefined ReadPreferences would be public, we could easily create new ones by extending them.
Real Example
In our case, we would like to create a ReadPreference that chooses one secondary node that does not have a special tag defined. This is currently not possible with the current predefined ReadPreferences, but would be very easy by extending the SecondaryPreferredReadPreference one.
- related to
-
JAVA-2666 Add option for applications to register a custom server selector
- Closed