1

I am making an application using akka-http with cloudant database. I have seen the documentation and there is max_connections variable, but I am still not sure if connection pooling is inherently done in cloudant. In the documentation cloudant code (Please refer to line 418) , there is a comment which says :

/** * Set the maximum number of connections to maintain in the connection pool. *

* Note: this setting only applies if using the optional OkHttp dependency. If OkHttp is not * present then the JVM configuration is used for pooling. Consult the JVM documentation for * the {@code http.maxConnections} property for further details.

I did not understand the comment properly and hence not sure if connection pooling is done when writing an application in akka-http? If yes, can someone please confirm. If not, can someone please guide as to how the connection pooling be done with cloudant.

kamini
  • 65
  • 1
  • 9

1 Answers1

2

See https://stackoverflow.com/a/41954800/5825497 - java-cloudant uses java.net.HttpURLConnection (either from the JVM or from OkHttp) to connect to Cloudant. Connection pooling is used by default, but the number of connections is controlled differently depending if the optional OkHttp is present or not.

Unless akka-http replaces the java.net.HttpURLConnection implementation then it will have no impact on the connection pooling of java-cloudant.

Community
  • 1
  • 1
ricellis
  • 396
  • 1
  • 4