9/11/2023 0 Comments Newest java![]() Ongoing requests will be canceled if the timeout setting is reached. The Java SDK now supports an end-to-end timeout policy, allowing developers to provide a timeout value that covers the whole execution of any request, including requests that span multiple partitions. We observed that many customers want to set aggressive end-to-end timeouts, which ultimately impacted tail latency and effectively caused availability to drop significantly since requests were not being canceled. Merging partitions in Azure Cosmos DB are now fully supported for the Java SDK, Spark Connector, and Spring Data Client Library! createItem( item, new PartitionKey( pkValue), optionsWithRetry). setNonIdempotentWriteRetryPolicy( ENABLE_RETRIES, USE_TRACKING_ID) ĪsyncContainer. String pkValue = "myPKValue" // whatever the logical partition key value is boolean ENABLE_RETRIES = true ĬosmosItemRequestOptions optionsWithRetry = new CosmosItemRequestOptions() But now, developers can now opt-in to retrying writes at a request level, even when these conditions are not met. Previously the SDK would only issue retries for write operations when the failure condition happened before the request was actually written to the network, or when the error code from the service guarantees that the service never processed the request. We’ve added support for retrying writes when they are not guaranteed to be idempotent. Check out code examples here! Note: this is currently available only for the core Java SDK, and is not yet supported for the other connectors at the time of writing. Support for hierarchical partition keys in Azure Cosmos DB was made GA for the Java SDK in March 2023. setAggressiveWarmupDuration( aggressiveWarmupDuration) setProactiveConnectionRegionsCount( proactiveConnectionRegionsCount) asList( containerIdentity1, containerIdentity2)) openConnectionsAndInitCaches( new CosmosContainerProactiveInitConfigBuilder( Arrays. asList( "sample_region_1", "sample_region_2")) building the client along with opening connections CosmosAsyncClient clientWithOpenConnections = new CosmosClientBuilder() duration for which connections are to be aggressively opened in a blocking manner // beyond this duration connections will be defensively opened in a non-blocking manner Duration aggressiveWarmupDuration = Duration. of regions to which connections are to be proactively opened int proactiveConnectionRegionsCount = 1 containers to which connections are to be proactively opened CosmosContainerIdentity containerIdentity1 = new CosmosContainerIdentity( "sample_db_id", "sample_container_id_1") ĬosmosContainerIdentity containerIdentity2 = new CosmosContainerIdentity( "sample_db_id", "sample_container_id_2") Once this duration elapses, connections are established defensively but in a non-blocking manner. A duration can also be specified within which connections are established aggressively in a blocking manner.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |