이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 3. Configuring reactive data sources with Quarkus
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
- Navigate to your Quarkus project directory.
In the
src/main/resources/application.propertiesfile, set the value of thequarkus.datasource.reactive.urlproperty 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_databaseOptionally, 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=20For example, to add a
postgresqldata 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
3.2. Disabling a reactive data source in a simultaneous configuration 링크 복사링크가 클립보드에 복사되었습니다!
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
- Navigate to your Quarkus project directory.
-
Open the
src/main/resources/application.propertiesfile. Set the
quarkus.datasource.reactiveproperty tofalseto disable the reactive data source:quarkus.datasource.reactive=false