Skip to content

Instantly share code, notes, and snippets.

@kevinhillinger
Created September 29, 2020 14:06
Show Gist options
  • Save kevinhillinger/d3769658066aec4c778398108461e0d1 to your computer and use it in GitHub Desktop.
Save kevinhillinger/d3769658066aec4c778398108461e0d1 to your computer and use it in GitHub Desktop.
Cosmos Java SDK Client configuration
Duration twelveHourTimeout = Duration.ofHours(12);
DirectConnectionConfig connectionConfig = new DirectConnectionConfig();
connectionConfig.setIdleConnectionTimeout(twelveHourTimeout);
connectionConfig.setIdleEndpointTimeout(twelveHourTimeout);
client = new CosmosClientBuilder()
.endpoint(AccountSettings.HOST)
.key(AccountSettings.MASTER_KEY)
.consistencyLevel(ConsistencyLevel.EVENTUAL)
.contentResponseOnWriteEnabled(true)
.directMode(connectionConfig)
.buildClient();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment