I am currently working on a project build based on Vert.x(Kotlin) and I need to connect to MySQL server. Vert.x provides this as the solution for the MySQL connection - https://vertx.io/docs/vertx-mysql-client/kotlin
I noticed that there are two approaches to implement this.
// Connect options
var connectOptions = MySQLConnectOptions(
port = 3306,
host = "the-host",
database = "the-db",
user = "user",
password = "secret")
// Pool options
var poolOptions = PoolOptions(
maxSize = 5)
// Create the pooled client
var client = MySQLPool.pool(connectOptions, poolOptions)
And
// Connect options
var connectOptions = MySQLConnectOptions(
port = 3306,
host = "the-host",
database = "the-db",
user = "user",
password = "secret")
// Pool options
var poolOptions = PoolOptions(
maxSize = 5)
// Create the pooled client
var client = MySQLPool.pool(vertx, connectOptions, poolOptions)
Vert.x dose not mention that under what kind of situation we should pass vertx, does anyone know about this? when we should use the second implementation?