How can I connect to an Atlas cluster with the SRV connection string format using ReactiveMongo?

684 Views Asked by At

I have a play scala app and i have an atlas cluster which i am trying to connect. According to the ReactiveMongo this is possible. I can add my connection string gotten from Atlas to my app via

mongodb.uri

In my application.conf file. I have tried everything based on the instructions from reactivemongo and atlas db but i am still unable to connect to the cluster. using my mongoshell however, i am able to connect and have access to my db but it simply refuses to connect via my app. Mongo simply returns an error "MongoError['No primary node is available! (Supervisor-13/Connection-14)']" } and logs a warning in my console Some options were ignored because they are not supported (yet): w, retryWrites. I am using scala version 2.12 and reactivemongo 0.12.6 with play 2.6. My connection string is mongodb+srv://<username>:<password>@my-cluster.abo25.mongodb.net/my-db?retryWrites=true&w=majority

Any info or help would be greatly appreciated.

1

There are 1 best solutions below

0
On

Solved my problem. It turns out the +srv string format works seamlessly from reactivemongo version 0.17 and i was initially on 0.16. After i upgraded (and also upgraded my code), i was able to connect to my cluster. I also found out one of the user credentials i was using was wrong so that plus the upgrade got me up and running.