I can successfully connect a standalone cluster to my Play Framework (2.7) app (with ReactiveMongo 0.17.1) and I can connect Mongo Compass to my replica set (created in MongoDb Atlas) but am having big problems connecting my MongoDb Atlas replica set to my Play Framework app. This should be a case of using the connection string in the application.conf file; i.e.
mongodb.uri = <connectionString>
In fact the ReactiveMongo documentation describes it as:
mongodb.uri = "mongodb+srv://${ATLAS_USERNAME}:${ATLAS_PASSWORD}@cluster0-p8ccg.mongodb.net/test?retryWrites=true&w=majority"
- with 3 variables of
${ATLAS_USERNAME},${ATLAS_PASSWORD}&test(default database name)
And the MongoDb Atlas documentation (when logged in) describes the connection string as being formulated like so:
mongodb+srv://<username>:<password>@cluster0.pwe0y.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
- with 3 variables of
<username>,<password>&myFirstDatabase(default database name)
So aside from some variable differences in the addresses (I use the one from Atlas as it is distinctive to my details)
The recurring error reads:
[error] r.c.a.MongoDBSystem - [Supervisor-1/Connection-2] Fails to send a isMaster request to cluster0-shard-00-01.pwe0y.mongodb.net:27017 (channel #ac1cfe76) javax.net.ssl.SSLException: SSLEngine closed already at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source)
Things to note:
- I have node.js v12.14.1
- the user is granted the appropriate permissions
- option parameters have also been
URL encodedtested - my ip address is in the
IP Access List(in Mongo Atlas)
For connection you should just pass the
mongodb.urias this:don't use the full connection string URL for the connection.