Skip to content

Provide ReadPreferenceResolver similar to WriteConcernResolver [DATAMONGO-947] #1856

Closed
@spring-projects-issues

Description

@spring-projects-issues

Alexej Kubarev opened DATAMONGO-947 and commented

In some applications it's required to change the readPreference for one or more repository (and keep it distinct from a default ReadPreference set on MongoTemplate).

A mechanism similar to WriteConcernResolver would make this very flexible and achieve this functionality.

Currently there are two workarounds which are not very clean:

  1. Creating repository in question with a different MongoTemplate (does not allow per-action preferences changes)
  2. Subclassing MongoTemplate and hooking in desired functionality there

Affects: 1.5 GA (Dijkstra)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions