Closed rmeyer20 closed 4 years ago
Ok, this issue has been resolved. Although this isn't made clear since all the other documentation points you to using the connection string, there's a separate URI listed under Azure (beginning https://). When I replaced it with that, it now gets passed that stage and fails with Caused by: com.azure.data.cosmos.CosmosClientException: Sql api is not supported for this database account. I will therefore close this issue.
[UPDATE] I have now tried simply adding my Azure properties to your sample application and am still getting the error. As such, is this project completely broken in its current state? Can someone else try it and confirm?
[ORIGINAL] I have followed the example code closely. Unfortunately when I run my Spring Boot application I get the following error:
I've delved into it a bit and it seems to stem from the fact that when it calls getServiceEndpoint().getURL(), there are no handlers for the MongoDB protocol. This is an incredibly simple setup using:
The URI is the connection string I've got from Azure e.g.
mongodb://account:key@url:port/?ssl=true&replicaSet=globaldb
This same URI works with MongoRepository and Spring Data setup, but unfortunately due to incompatibilities with regards to shard keys and CosmoDB, II've opted to use this library. I've made sure I'm using the same versions as the example. As one last thing, here are the dependencies:
I have raised this as an issue rather than a question as I haven't done anything beyond what the example project does which can only mean there's something not quite right. I've tried using other builds (other than 2.2.2) but it gives the same result. The only version that doesn't error and successfully connects to CosmoDB is 2.1.x (and below). Unfortunately that errors with a "Sql is not supported on this account" when trying to post documents. As an FYI, I'm using MacOSX though I doubt this would affect things.