microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
94 stars 64 forks source link

How to set request unit for a colection from property file #354

Closed anshul-dhyani closed 4 years ago

anshul-dhyani commented 5 years ago

Hi,

We want to have different request unit for our application in different environments, for that we thought to add a property in application.properties and can reference like below : @Document(collection = "collectionX" , ru = "${collection.ru}")

but while trying to resolve ${collection.ru} it is not evaluating as it is not receiving the value for parsing but getting the same string.

How can we give different ru values for different environment dynamically ?

Incarnation-p-lee commented 5 years ago

@anshul-dhyani Thanks for issue this. The @Document config about ru is designed to multiple repositories with different ru values. By default, it only support literal value instead of placeholder.

But you can do that by provide one customize RequestOption as configuration properties when you config. And then update ru by setOfferThroughput.

anshul-dhyani commented 5 years ago

@Incarnation-p-lee ,

Thank you for the quick reply, but do we have any sample how to use it with spring data for cosmos db

kushagraThapar commented 4 years ago

@anshul-dhyani - Please feel free to re-open this issue if you are still facing the problem.