Skip to content
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

ConsistencyPolicy.defaultConsistencyLevel() fails on Bounded Staleness and Consistent Prefix #6707

Closed
kushagraThapar opened this issue Dec 9, 2019 · 2 comments
Assignees
Labels
cosmos:v4-item Indicates this feature will be shipped as part of V4 release train Cosmos
Milestone

Comments

@kushagraThapar
Copy link
Member

kushagraThapar commented Dec 9, 2019

Describe the bug
ConsistencyPolicy.defaultConsistencyLevel() API doesn't work properly when reading consistency level from the response json in case of Bounded Staleness and Consistent Prefix.

Exception or Stack Trace
Initializing DocumentClient with serviceEndpoint [https://*-cosmosdb.documents.azure.com:/], connectionPolicy [ConnectionPolicy{requestTimeoutInMillis=60000, mediaRequestTimeoutInMillis=300000, connectionMode=GATEWAY, maxPoolSize=1000, idleConnectionTimeoutInMillis=60000, userAgentSuffix=';spring-data/2.2.0;6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead;;spring-data/2.2.0;6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead;', retryOptions=RetryOptions{maxRetryAttemptsOnThrottledRequests=9, maxRetryWaitTimeInSeconds=30}, enableEndpointDiscovery=true, preferredLocations=null, usingMultipleWriteLocations=false, inetSocketProxyAddress=null}], consistencyLevel [BoundedStaleness], directModeProtocol [Tcp]

2019-12-09 12:31:21,368 WARN [reactor-http-nio-2] com.azure.data.cosmos.ConsistencyPolicy : Unknown consistency level BoundedStaleness, value ignored.

To Reproduce
Create a cosmos db account with default consistency as Bounded Staleness or Consistent Prefix.

Code Snippet

result = ConsistencyLevel.valueOf(StringUtils.upperCase(super.getString(Constants.Properties.DEFAULT_CONSISTENCY_LEVEL)));

Expected behavior
Parsing code should be changed to handle consistencies with underscore in their enum.

@kushagraThapar
Copy link
Member Author

kushagraThapar commented Dec 31, 2019

This has been released in spring-data-cosmosdb v2.2.1

@kushagraThapar
Copy link
Member Author

This has been fixed in all SDK versions, closing this now.

Cosmos DB SDK team automation moved this from To do to Done Jan 8, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cosmos:v4-item Indicates this feature will be shipped as part of V4 release train Cosmos
Projects
Development

No branches or pull requests

1 participant