此内容没有您所选择的语言版本。

Chapter 3. Reactive data source configuration


You can use a reactive data source driver to connect your application to a relational database.

3.1. Setting the reactive data source connection URL

You must configure the connection URL for the reactive data source to complete configuration of your data source.

Prerequisites

  • You have a Quarkus Maven project.
  • You have added a reactive data source driver to your application.

Procedure

  1. Navigate to your Quarkus project directory.
  2. In the src/main/resources/application.properties file, set the value of the quarkus.datasource.reactive.url property to match the connection URL of your reactive data source:

    quarkus.datasource.reactive.url=<datasource_URL>

    For example, to set the reactive data source connection URL for the PostgreSQL data source:

    quarkus.datasource.reactive.url=postgresql:///your_database
  3. Optionally, you can set the maximum number of connections in the connection pool of your data source to improve the performance of your application:

    quarkus.datasource.reactive.max-size=20

    For example, to add a postgresql data source with a reactive data source driver:

    quarkus.datasource.db-kind=postgresql
    quarkus.datasource.username=<your_username>
    quarkus.datasource.password=<your_password>
    
    quarkus.datasource.reactive.url=postgresql://localhost:5432/quarkus_test_database
    quarkus.datasource.reactive.max-size=20

You can simultaneously configure a reactive driver extension and a JDBC driver extension for the same data source in your application. You can disable the reactive data source driver in a simultaneous configuration, thus forcing your application to use the JDBC data source driver.

Prerequisites

  • You have a Quarkus Maven project.
  • You have a JDBC data source driver and a reactive data source driver configured simultaneously in your application.

Procedure

  1. Navigate to your Quarkus project directory.
  2. Open the src/main/resources/application.properties file.
  3. Set the quarkus.datasource.reactive property to false to disable the reactive data source:

    quarkus.datasource.reactive=false
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部