Skip to content

Support configuring default DurabilityLevel, PersistTo, ReplicateTo values #1063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aaronjwhiteside opened this issue Jan 21, 2021 · 4 comments · Fixed by #1721
Closed

Support configuring default DurabilityLevel, PersistTo, ReplicateTo values #1063

aaronjwhiteside opened this issue Jan 21, 2021 · 4 comments · Fixed by #1721
Labels
type: enhancement A general enhancement

Comments

@aaronjwhiteside
Copy link
Contributor

aaronjwhiteside commented Jan 21, 2021

In our organization it's rare that we require specific durability per document, typically it's the same across all our documents and even projects.

It would be nice if we could drive this by a configuration property in application.properties, though I expect Spring Boot to actually contain that logic via CouchbaseDataProperties, but it would be nice if Spring Data Couchbase exposed a way to supply these values.

@aaronjwhiteside aaronjwhiteside changed the title Support configuring global DurabilityLevel, PersistTo, ReplicateTo values Support configuring default DurabilityLevel, PersistTo, ReplicateTo values Jan 21, 2021
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 21, 2021
@aaronjwhiteside
Copy link
Contributor Author

Building on this, there is also no current way to specify the durability for a Repository#save call.

To reinforce the configurability requirement above, when testing locally developers typically have a single node cluster, but when deploying in production you want to ensure that data hits more than a single node. This may preclude using an annotation on the Repository level. Unless it reads configuration via a SpEL expression.

@mikereiche
Copy link
Collaborator

mikereiche commented Aug 11, 2021

Starting in spring-data-couchbase-4.3.0-M2 repository.withOptions(Upsert/ReplaceOptions).save(...) will be supported.
Similarily for template :
couchbaseTemplate.findById(Airport.class).withOptions(getOptions).one(id);

Should be here by the end of the week:

https://repo.spring.io/artifactory/libs-milestone-local/org/springframework/data/spring-data-couchbase/4.3.0-M2/spring-data-couchbase-4.3.0-M2.jar

https://repo.spring.io/ui/repos/tree/General/libs-milestone

@mikereiche
Copy link
Collaborator

Annotations could be added in the future (similar to ScanConsistency) - on methods, repository and entity.

@mikereiche mikereiche added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 11, 2021
@mikereiche
Copy link
Collaborator

Durability annotation to be added in the same places as ScanConsistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants