My spring-boot service, running behind the AWS load balancer, needs to connect to the Serverless MongoDB instance.
I am using the latest spring-boot version — 2.5.5
The spring-boot service fails to connect to the serverless MongoDB with the below error message:
Caused by: com.mongodb.MongoConfigurationException: A TXT record is only permitted to contain the keys [authsource, replicaset], but the TXT record for ‘eyeplayserverlessinstan.iwf5e.mongodb.net’ contains the keys [loadbalanced, authsource]
My question: Is the serverless MongoDB, being in its beta version, supported by the Spring framework? And if it is supported, why is it not able to connect? Thanks!
If you are trying to connect to Atlas Serverless you will need Spring Boot 2.6.0 or newer.
If you are having trouble connecting to a different type of deployment, please start a new discussion topic with more details including your MongoDB server version, deployment type, and the specific error message received.