Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from quarkusio:main #39

Merged
merged 12 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 9 additions & 26 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<!-- See root POM for hibernate-orm.version, hibernate-reactive.version, hibernate-validator.version,
hibernate-search.version, antlr.version, bytebuddy.version, hibernate-commons-annotations.version -->
<narayana.version>7.1.0.Final</narayana.version>
<narayana-lra.version>0.0.9.Final</narayana-lra.version>
<agroal.version>2.5</agroal.version>
<jboss-transaction-spi.version>8.0.0.Final</jboss-transaction-spi.version>
<elasticsearch-opensource-components.version>8.16.1</elasticsearch-opensource-components.version>
Expand Down Expand Up @@ -4781,14 +4782,10 @@
<version>${microprofile-lra.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>narayana-lra</artifactId>
<version>${narayana.version}</version>
<version>${narayana-lra.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.narayana.rts</groupId>
<artifactId>narayana-lra</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand All @@ -4804,14 +4801,10 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>lra-service-base</artifactId>
<version>${narayana.version}</version>
<version>${narayana-lra.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.narayana.rts</groupId>
<artifactId>lra-service-base</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand All @@ -4824,25 +4817,15 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>lra-proxy-api</artifactId>
<version>${narayana.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.narayana.rts</groupId>
<artifactId>lra-proxy-api</artifactId>
</exclusion>
</exclusions>
<version>${narayana-lra.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>lra-client</artifactId>
<version>${narayana.version}</version>
<version>${narayana-lra.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.narayana.rts</groupId>
<artifactId>lra-client</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public final class GeneratedClassBuildItem extends MultiBuildItem {

final boolean applicationClass;
final String name;
String binaryName;
String internalName;
final byte[] classData;
final String source;

Expand All @@ -27,10 +29,39 @@ public boolean isApplicationClass() {
return applicationClass;
}

/**
* {@return a name for this class}
*
* @deprecated This method may return the binary name, the internal name, or a hybrid thereof and should not be
* used. Use {@link #binaryName()} or {@link #internalName()} instead.
*/
@Deprecated(forRemoval = true)
public String getName() {
return name;
}

/**
* {@return the <em>binary name</em> of the class, which is delimited by <code>.</code> characters}
*/
public String binaryName() {
String binaryName = this.binaryName;
if (binaryName == null) {
binaryName = this.binaryName = name.replace('/', '.');
}
return binaryName;
}

/**
* {@return the <em>internal name</em> of the class, which is delimited by <code>/</code> characters}
*/
public String internalName() {
String internalName = this.internalName;
if (internalName == null) {
internalName = this.internalName = name.replace('.', '/');
}
return internalName;
}

public byte[] getClassData() {
return classData;
}
Expand All @@ -39,4 +70,7 @@ public String getSource() {
return source;
}

public String toString() {
return "GeneratedClassBuildItem[" + binaryName() + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Conditional dependencies can also be configured in the Quarkus extension descrip
</goals>
<configuration>
<conditionalDependencies> <3>
<extension>org.acme:quarkus-extension-b:${b.version}</extension> <4>
<artifact>org.acme:quarkus-extension-b:${b.version}</artifact> <4>
</conditionalDependencies>
</configuration>
</execution>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/rest-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ public class MyResponseExceptionMapper implements ResponseExceptionMapper<Runtim
`ResponseExceptionMapper` also defines the `getPriority` method which is used in order to determine the priority with which `ResponseExceptionMapper` implementations will be called (implementations with a lower value for `getPriority` will be invoked first).
If `toThrowable` returns an exception, then that exception will be thrown. If `null` is returned, the next implementation of `ResponseExceptionMapper` in the chain will be called (if there is any).

The class as written above, would not be automatically be used by any REST Client. To make it available to every REST Client of the application, the class needs to be annotated with `@Provider` (as long as `quarkus.rest-client-reactive.provider-autodiscovery` is not set to `false`).
The class as written above, would not be automatically be used by any REST Client. To make it available to every REST Client of the application, the class needs to be annotated with `@Provider` (as long as `quarkus.rest-client.provider-autodiscovery` is not set to `false`).
Alternatively, if the exception handling class should only apply to specific REST Client interfaces, you can either annotate the interfaces with `@RegisterProvider(MyResponseExceptionMapper.class)`, or register it using configuration using the `providers` property of the proper `quarkus.rest-client` configuration group.

=== Using @ClientExceptionMapper
Expand Down Expand Up @@ -2025,7 +2025,7 @@ While the REST Client extension aims to be a drop-in replacement for the RESTEas
and limitations:

- the default scope of the client for the new extension is `@ApplicationScoped` while the `quarkus-resteasy-client` defaults to `@Dependent`
To change this behavior, set the `quarkus.rest-client-reactive.scope` property to the fully qualified scope name.
To change this behavior, set the `quarkus.rest-client.scope` property to the fully qualified scope name.
- it is not possible to set `HostnameVerifier` or `SSLContext`
- a few things that don't make sense for a non-blocking implementations, such as setting the `ExecutorService`, don't work

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.agroal.runtime;

import java.util.Map;

import org.jboss.logging.Logger;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
Expand All @@ -8,10 +10,19 @@ public interface AgroalConnectionConfigurer {

Logger log = Logger.getLogger(AgroalConnectionConfigurer.class.getName());

/**
* @deprecated use {@link #disableSslSupport(String, AgroalDataSourceConfigurationSupplier, Map)} instead
*/
@Deprecated(since = "3.18", forRemoval = true)
default void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
log.warnv("Agroal does not support disabling SSL for database kind: {0}", databaseKind);
}

default void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalJdbcProperties) {
disableSslSupport(databaseKind, dataSourceConfiguration);
}

default void setExceptionSorter(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
log.warnv("Agroal does not support detecting if a connection is still usable after an exception for database kind: {0}",
databaseKind);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ public AgroalDataSource createDataSource(String dataSourceName) {
mpMetricsPresent);

if (agroalDataSourceSupport.disableSslSupport) {
agroalConnectionConfigurer.disableSslSupport(resolvedDbKind, dataSourceConfiguration);
agroalConnectionConfigurer.disableSslSupport(resolvedDbKind, dataSourceConfiguration,
dataSourceJdbcRuntimeConfig.additionalJdbcProperties());
}
//we use a custom cache for two reasons:
//fast thread local cache should be faster
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.jdbc.h2.runtime;

import java.util.Map;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
import io.quarkus.agroal.runtime.AgroalConnectionConfigurer;
import io.quarkus.agroal.runtime.JdbcDriver;
Expand All @@ -9,7 +11,8 @@
public class H2AgroalConnectionConfigurer implements AgroalConnectionConfigurer {

@Override
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalProperties) {
// do not log anything for H2
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.jdbc.mariadb.runtime;

import java.util.Map;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
import io.agroal.api.exceptionsorter.MySQLExceptionSorter;
import io.quarkus.agroal.runtime.AgroalConnectionConfigurer;
Expand All @@ -10,7 +12,8 @@
public class MariaDBAgroalConnectionConfigurer implements AgroalConnectionConfigurer {

@Override
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalProperties) {
dataSourceConfiguration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcProperty("useSSL", "false");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.jdbc.mssql.runtime;

import java.util.Map;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
import io.agroal.api.exceptionsorter.MSSQLExceptionSorter;
import io.quarkus.agroal.runtime.AgroalConnectionConfigurer;
Expand All @@ -10,7 +12,8 @@
public class MsSQLAgroalConnectionConfigurer implements AgroalConnectionConfigurer {

@Override
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalProperties) {
dataSourceConfiguration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcProperty("encrypt", "false");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.jdbc.mysql.runtime;

import java.util.Map;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
import io.agroal.api.exceptionsorter.MySQLExceptionSorter;
import io.quarkus.agroal.runtime.AgroalConnectionConfigurer;
Expand All @@ -10,7 +12,8 @@
public class MySQLAgroalConnectionConfigurer implements AgroalConnectionConfigurer {

@Override
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalProperties) {
dataSourceConfiguration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcProperty("useSSL", "false");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkus.jdbc.oracle.runtime;

import java.util.Properties;
import java.util.Map;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
import io.agroal.api.exceptionsorter.OracleExceptionSorter;
Expand All @@ -19,13 +19,10 @@ public class OracleAgroalConnectionConfigurer implements AgroalConnectionConfigu
* enable it.
*/
@Override
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
final Properties jdbcProperties = dataSourceConfiguration.connectionPoolConfiguration()
.connectionFactoryConfiguration()
.get()
.jdbcProperties();
final Object setting = jdbcProperties.get("oracle.net.authentication_services");
if (setting != null && "SSL".equalsIgnoreCase(setting.toString())) {
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalProperties) {
final String property = additionalProperties.get("oracle.net.authentication_services");
if (property != null && "SSL".equalsIgnoreCase(property)) {
log.warnv(
"SSL support has been disabled, but one of the Oracle JDBC connections has been configured to use SSL. This will likely fail");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.jdbc.postgresql.runtime;

import java.util.Map;

import io.agroal.api.configuration.supplier.AgroalDataSourceConfigurationSupplier;
import io.agroal.api.exceptionsorter.PostgreSQLExceptionSorter;
import io.quarkus.agroal.runtime.AgroalConnectionConfigurer;
Expand All @@ -10,7 +12,8 @@
public class PostgreSQLAgroalConnectionConfigurer implements AgroalConnectionConfigurer {

@Override
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration) {
public void disableSslSupport(String databaseKind, AgroalDataSourceConfigurationSupplier dataSourceConfiguration,
Map<String, String> additionalProperties) {
dataSourceConfiguration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcProperty("sslmode",
"disable");
}
Expand Down
12 changes: 6 additions & 6 deletions extensions/narayana-lra/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>narayana-lra</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>lra-service-base</artifactId>
<exclusions>
<exclusion>
Expand All @@ -34,7 +34,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>lra-proxy-api</artifactId>
<exclusions>
<exclusion>
Expand All @@ -44,7 +44,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<groupId>org.jboss.narayana.lra</groupId>
<artifactId>lra-client</artifactId>
</dependency>
<dependency>
Expand All @@ -69,11 +69,11 @@
<configuration>
<removedResources>
<artifact>
<key>org.jboss.narayana.rts:narayana-lra</key>
<key>org.jboss.narayana.lra:narayana-lra</key>
<resources>META-INF/services/jakarta.ws.rs.client.ClientBuilder</resources>
</artifact>
<artifact>
<key>org.jboss.narayana.rts:lra-client</key>
<key>org.jboss.narayana.lra:lra-client</key>
<resources>META-INF/services/jakarta.ws.rs.client.ClientBuilder</resources>
</artifact>
</removedResources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public interface TlsConfig {

/**
* The hostname verification algorithm to use in case the server's identity should be checked.
* Should be {@code HTTPS}, {@code LDAPS} or an {@code NONE} (default).
* Should be {@code HTTPS}, {@code LDAPS} or {@code NONE} (default).
* <p>
* If set to {@code NONE}, it does not verify the hostname.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ boolean isKafkaConnector(List<ConnectorManagedChannelBuildItem> list, boolean in
});

assertThat(generated)
.extracting(GeneratedClassBuildItem::getName)
.extracting(GeneratedClassBuildItem::internalName)
.allSatisfy(s -> assertThat(generatedNames).satisfiesOnlyOnce(c -> c.apply(s)));

assertThat(reflective)
.flatExtracting(ReflectiveClassBuildItem::getClassNames)
.extracting(n -> n.replace('/', '.'))
.allSatisfy(s -> assertThat(reflectiveNames).satisfiesOnlyOnce(c -> c.apply(s)));
} finally {
// must not leak the lazily-initialized Config instance associated to the system classloader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public interface TlsBucketConfig {

/**
* The hostname verification algorithm to use in case the server's identity should be checked.
* Should be {@code HTTPS} (default), {@code LDAPS} or an {@code NONE}.
* Should be {@code HTTPS} (default), {@code LDAPS} or {@code NONE}.
* <p>
* If set to {@code NONE}, it does not verify the hostname.
* <p>
Expand Down
Loading