Search in sources :

Example 6 with MySQLPool

use of io.vertx.mysqlclient.MySQLPool in project quarkus by quarkusio.

the class ReactiveMySQLDataSourcesHealthCheck method init.

@PostConstruct
protected void init() {
    ArcContainer container = Arc.container();
    DataSourcesHealthSupport excluded = container.instance(DataSourcesHealthSupport.class).get();
    Set<String> excludedNames = excluded.getExcludedNames();
    for (InstanceHandle<MySQLPool> handle : container.select(MySQLPool.class, Any.Literal.INSTANCE).handles()) {
        String poolName = getPoolName(handle.getBean());
        if (!excludedNames.contains(poolName)) {
            addPool(poolName, handle.get());
        }
    }
}
Also used : ArcContainer(io.quarkus.arc.ArcContainer) DataSourcesHealthSupport(io.quarkus.datasource.runtime.DataSourcesHealthSupport) MySQLPool(io.vertx.mysqlclient.MySQLPool) PostConstruct(javax.annotation.PostConstruct)

Example 7 with MySQLPool

use of io.vertx.mysqlclient.MySQLPool in project quarkus by quarkusio.

the class MySQLPoolRecorder method configureMySQLPool.

public RuntimeValue<MySQLPool> configureMySQLPool(RuntimeValue<Vertx> vertx, Supplier<Integer> eventLoopCount, String dataSourceName, DataSourcesRuntimeConfig dataSourcesRuntimeConfig, DataSourcesReactiveRuntimeConfig dataSourcesReactiveRuntimeConfig, DataSourcesReactiveMySQLConfig dataSourcesReactiveMySQLConfig, ShutdownContext shutdown) {
    MySQLPool mysqlPool = initialize(vertx.getValue(), eventLoopCount.get(), dataSourcesRuntimeConfig.getDataSourceRuntimeConfig(dataSourceName), dataSourcesReactiveRuntimeConfig.getDataSourceReactiveRuntimeConfig(dataSourceName), dataSourcesReactiveMySQLConfig.getDataSourceReactiveRuntimeConfig(dataSourceName));
    shutdown.addShutdownTask(mysqlPool::close);
    return new RuntimeValue<>(mysqlPool);
}
Also used : MySQLPool(io.vertx.mysqlclient.MySQLPool) RuntimeValue(io.quarkus.runtime.RuntimeValue)

Aggregations

MySQLPool (io.vertx.mysqlclient.MySQLPool)7 MySQLConnectOptions (io.vertx.mysqlclient.MySQLConnectOptions)4 PoolOptions (io.vertx.sqlclient.PoolOptions)4 MySQLConnectionImpl (io.vertx.mysqlclient.impl.MySQLConnectionImpl)2 SQLUtils (com.alibaba.druid.sql.SQLUtils)1 SQLReplaceable (com.alibaba.druid.sql.ast.SQLReplaceable)1 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)1 SQLVariantRefExpr (com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr)1 MySqlASTVisitorAdapter (com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitorAdapter)1 ImmutableList (com.google.common.collect.ImmutableList)1 RowBaseIterator (io.mycat.api.collector.RowBaseIterator)1 MycatTest (io.mycat.assemble.MycatTest)1 MycatMySQLRowMetaData (io.mycat.beans.mycat.MycatMySQLRowMetaData)1 MycatRelDataType (io.mycat.beans.mycat.MycatRelDataType)1 MycatRowMetaData (io.mycat.beans.mycat.MycatRowMetaData)1 ResultSetBuilder (io.mycat.beans.mycat.ResultSetBuilder)1 MySQLFieldsType (io.mycat.beans.mysql.MySQLFieldsType)1 ColumnDefPacket (io.mycat.beans.mysql.packet.ColumnDefPacket)1 ColumnDefPacketImpl (io.mycat.beans.mysql.packet.ColumnDefPacketImpl)1 ArcContainer (io.quarkus.arc.ArcContainer)1