Mongo DB connections are not getting closed,While using reactive spring boot infinite streams - spring

I am using Reactive Spring Boot (Flux) for infinite streams and #Tailable in a Reactive Mongo Repository to enable server side events. For each request to the Flux controller, it is creating a brand new MongoDB connection, although I am using the reactive Mongo client to create the connection. Because of this after 100 connections the application is throwing a MongoDB connection timeout exception. Below is my code.
REST Controller
Reactive Mongo Repository :
Please advise, if anyone knows how to fix this!

Related

Hazelcast Reactive Client

Trying to find hazelcast reactive client to read/update cache.
But don't find any reactive client.
Any sample example is much appreciated.
Thanks & Regards
Ayash Kant Baral
Able to connect with hazelcast server using non reactive client

How can I get InstanceInfo from Spring Cloud Netflix's when client disconnects?

I want to get the InstanceInfo of the disconnected client with EurekaInstanceCanceledEvent event on Spring Boot for accessing the client metadataMap. Is there any way to do so without rolling my own solution? Can't seem to find any way around!
Thanks for your time!

Spring Data JPA repository keep connection open in a request

my problem is a bit complicated to explain, but basically seems that there some relation between my number of active connections and the delay to get some data from a remote server (web service). I mean I have a query to get some data in the database and after that a I do a call to this webserver, but everytime the latency of this webservice increase my connection in the database start to increase as well. I'm using Spring data jpa and Spring Boot.

Check MongoDB Status with Spring Boot

How do I check, if the connection to the MongoDB is active (without using the actuator project) if just a MongoRepository is used, which hides the connection?
If mongodb connection is inactive then spring boot application will throw errors which can be checked in logs.
Ideally actuator project is best way to check the status.
You can also check the status by creating your own controller method lets say ping and in implementation write some operation like MongoRepository.findAll() if it returns positive value it is in active state.

MongoDB in spring web project

I am writing a web project in spring 3.1.0, and I am using mongodb 1.0.0.RELEASE.
I need to get the MongoTemplate object into the controller without opening unnecessary new connections, something like a pool? How can I do this?
Thanks
MongoTemplate uses MongoDB java driver which does connection pooling. You could optionally configure the number of connections, timeouts, etc.

Resources