Unable to connect to mongodb on remote server

I have a spring boot application with a mongo database on localhost and everything work fine.
Now i want to deploy my application to my server and the database is on another remote server.
I changed mongod.conf file and uncommented “bindIp: 0.0.0.0 #default value is 127.0.0.1”
In my application.properties file i have this:
“spring.data.mongodb.uri=mongodb://172.16.4.26:27017/jenkinsdb”
When i run my application i get “com.mongodb.MongoSocketOpenException: Exception opening socket” caused by “Caused by: java.net.SocketTimeoutException: connect timed out”

i am aslo facing the same issue i was try to access the mongodb running in one machine through another but i am facing socket exception can anyone please guide me with this

What is the exact socket exception you are getting?