Skip to content

Commit

Permalink
Merge pull request #22810 from tsegismont/oracle_client
Browse files Browse the repository at this point in the history
Reactive Oracle Client extension
  • Loading branch information
gsmet authored Jan 12, 2022
2 parents ce96b00 + da66953 commit 34374c8
Show file tree
Hide file tree
Showing 42 changed files with 1,669 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,16 @@
<artifactId>quarkus-reactive-mssql-client-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-oracle-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-oracle-client-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-mailer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public enum Feature {
REACTIVE_MYSQL_CLIENT,
REACTIVE_MSSQL_CLIENT,
REACTIVE_DB2_CLIENT,
REACTIVE_ORACLE_CLIENT,
REACTIVE_ROUTES,
REDIS_CLIENT,
RESTEASY,
Expand Down
13 changes: 13 additions & 0 deletions devtools/bom-descriptor-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-oracle-client</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-pg-client</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-oracle-client-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-pg-client-deployment</artifactId>
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/credentials-provider.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ by the following credentials consumer extensions:
* `reactive-db2-client`
* `reactive-mysql-client`
* `reactive-mssql-client`
* `reactive-oracle-client`
* `reactive-pg-client`
* `oidc`
* `oidc-client`
Expand Down
4 changes: 4 additions & 0 deletions docs/src/main/asciidoc/datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,10 @@ include::{generated-dir}/config/quarkus-reactive-mysql-client.adoc[opts=optional

include::{generated-dir}/config/quarkus-reactive-mssql-client.adoc[opts=optional, leveloffset=+1]

=== Reactive Oracle Specific Configuration

include::{generated-dir}/config/quarkus-reactive-oracle-client.adoc[opts=optional, leveloffset=+1]

=== Reactive PostgreSQL Specific Configuration

include::{generated-dir}/config/quarkus-reactive-pg-client.adoc[opts=optional, leveloffset=+1]
9 changes: 9 additions & 0 deletions docs/src/main/asciidoc/reactive-sql-clients.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ Navigate to http://localhost:8080/fruits.html and read/create/delete some fruits
|`io.vertx.mutiny.mssqlclient.MSSQLPool`
|`@p1`, `@p2`, etc.

|Oracle
|`quarkus-reactive-oracle-client`
|`io.vertx.mutiny.oracleclient.OraclePool`
|`?`

|PostgreSQL
|`quarkus-reactive-pg-client`
|`io.vertx.mutiny.pgclient.PgPool`
Expand Down Expand Up @@ -713,6 +718,10 @@ include::{generated-dir}/config/quarkus-reactive-mysql-client.adoc[opts=optional

include::{generated-dir}/config/quarkus-reactive-mssql-client.adoc[opts=optional, leveloffset=+1]

=== Oracle

include::{generated-dir}/config/quarkus-reactive-oracle-client.adoc[opts=optional, leveloffset=+1]

=== PostgreSQL

include::{generated-dir}/config/quarkus-reactive-pg-client.adoc[opts=optional, leveloffset=+1]
4 changes: 4 additions & 0 deletions docs/src/main/asciidoc/vertx-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ Refer to the associated documentation to learn how to use them.
|`io.quarkus:quarkus-reactive-mysql-client` (extension)
|https://quarkus.io/guides/reactive-sql-clients

|Oracle Client
|`io.quarkus:quarkus-reactive-oracle-client` (extension)
|https://quarkus.io/guides/reactive-sql-clients

|PostgreSQL Client
|`io.quarkus:quarkus-reactive-pg-client` (extension)
|https://quarkus.io/guides/reactive-sql-clients
Expand Down
1 change: 1 addition & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<module>reactive-pg-client</module>
<module>reactive-mysql-client</module>
<module>reactive-mssql-client</module>
<module>reactive-oracle-client</module>
<module>mailer</module>
<module>grpc</module>
<module>redis-client</module>
Expand Down
202 changes: 202 additions & 0 deletions extensions/reactive-oracle-client/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-oracle-client-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>

<artifactId>quarkus-reactive-oracle-client-deployment</artifactId>

<name>Quarkus - Reactive Oracle Client - Deployment</name>

<properties>
<reactive-oracledb.url>vertx-reactive:oracle:thin:@localhost:1521:XE</reactive-oracledb.url>
<!-- See https://hub.docker.com/r/gvenzl/oracle-xe -->
<oracle.image>gvenzl/oracle-xe:21.3.0-slim</oracle.image>
</properties>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-datasource-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices-oracle</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-credentials-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-oracle-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health-spi</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-deployment</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health-deployment</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${project.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>test-oracle</id>
<activation>
<property>
<name>test-containers</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>docker-oracle</id>
<activation>
<property>
<name>start-containers</name>
</property>
</activation>
<properties>
<reactive-oracledb.url>vertx-reactive:oracle:thin:@localhost:1521:XE</reactive-oracledb.url>
</properties>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${oracle.image}</name>
<run>
<ports>
<port>1521:1521</port>
</ports>
<env>
<ORACLE_PASSWORD>hibernate_orm_test</ORACLE_PASSWORD>
</env>
<log>
<prefix>Oracle Database: </prefix>
<date>default</date>
<color>red</color>
</log>
<wait>
<!-- good docs found at: http://dmp.fabric8.io/#build-healthcheck -->
<!-- Unfortunately booting this is slow, needs to set a generous timeout: -->
<time>60000</time>
<log>DATABASE IS READY TO USE!</log>
</wait>
</run>
</image>
</images>
<!--Stops all Oracle DB images currently running, not just those we just started.
Useful to stop processes still running from a previously failed integration test run -->
<allContainers>true</allContainers>
</configuration>
<executions>
<execution>
<id>docker-start</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>docker-prune</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${docker-prune.location}</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.reactive.oracle.client.deployment;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.datasource.common.runtime.DataSourceUtil;
import io.quarkus.runtime.RuntimeValue;
import io.vertx.oracleclient.OraclePool;

public final class OraclePoolBuildItem extends MultiBuildItem {

private final String dataSourceName;

private final RuntimeValue<OraclePool> oraclePool;

public OraclePoolBuildItem(String dataSourceName, RuntimeValue<OraclePool> oraclePool) {
this.dataSourceName = dataSourceName;
this.oraclePool = oraclePool;
}

public String getDataSourceName() {
return dataSourceName;
}

public RuntimeValue<OraclePool> getOraclePool() {
return oraclePool;
}

public boolean isDefault() {
return DataSourceUtil.isDefault(dataSourceName);
}

}
Loading

0 comments on commit 34374c8

Please sign in to comment.