Hi,
We got one requirement where we have to use Cosmos DB. We are using Azure Java SDK (azure-cosmos', version: '4.16.0).
We are generating CosmosClient object with Resource token which expires in an hour. So we have to re-instantiate CosmosClient with a new resource token.
This way we are unable to keep CosmosClient as Singleton (as recommended by Azure). We are ending up creating several CosmosClient objects on the expiry of the resource token causing memory leak.
Can you please suggest the best way of creating CosmosClient with Resource Token in Java (Sprinboot)?
We are referring to the below links for cosmos DB connection:
Thanks,
Ganesh