Configure mongodb property maxWaitQueueSize in Spring boot application?
<p>I get the error <code>com.mongodb.MongoWaitQueueFullException: Too many threads are already waiting for a connection. Max number of threads (maxWaitQueueSize) of 500 has been exceeded.</code> while doing a stress test on my application.</p>

<p>So I am thinking of configuring the <code>maxWaitQueueSize</code> property via configuration.</p>

<p>I am using spring boot to configure mongodb connection. I am using @EnableAutoConfiguration in my Application and I have declared  only <code>spring.data.mongodb.uri=mongodb://user:password@ip:27017</code> in the application.properties file. </p>

<p>How do I configure the <code>maxWaitQueueSize</code> property with spring boot?</p>

<p>How do I decide a good value for the <code>maxWaitQueueSize</code>?</p>