microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
93 stars 68 forks source link

Modify default connection policy with cosmosdb springboot starter #540

Open BingjieGao opened 4 years ago

BingjieGao commented 4 years ago

Hi Microsoft Team, I'm using azure-cosmosdb-spring-boot-starter version 2.3.1, and by default it's using

connectionMode=DIRECT
directModeProtocol [Tcp]

could you help how to make the connectionMode into Gateway? I could see there should be such property could be configured in application.properties file

azure.cosmosdb.connection-policy=
BingjieGao commented 4 years ago

Hi Microsoft Team, From the source code I got for version 2.3.1 of springboot-starter it seems there is no way to switch to GATEWAY mode but always default set to be DIRECT TCP.

// This is a temp fix as CosmosDbFactory does not support loading ConnectionPolicy bean from context

Is this the right behavioir?

kushagraThapar commented 4 years ago

@BingjieGao - This is a spring-boot-starter issue, can you please open the issue here : https://github.com/microsoft/azure-spring-boot