有人可以帮助配置MySQL reactive client with the quarkus吗?我需要什么插件/扩展?要配置相同的应用程序属性的最低要求是什么?
发布于 2020-04-08 15:35:36
您需要添加单个依赖项,对于mysql,它将是:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-mysql-client</artifactId>
</dependency>然后,在应用程序属性中,您需要指定数据源信息,对我来说最小的设置是:
quarkus.datasource.url=vertx-reactive:mysql://localhost:3306/{database}
quarkus.datasource.username=root
quarkus.datasource.password=root根据需要更换主机、端口、数据库和凭据
最后一部分是使用MySQLPool,只需将其注入到某个bean中:
@Inject
MySQLPool pool;你也可以试试我的example repo
https://stackoverflow.com/questions/61093939
复制相似问题