This is an automated email from the ASF dual-hosted git repository.

fjtiradosarti pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-runtimes.git


The following commit(s) were added to refs/heads/main by this push:
     new 56a70ed754 [Fix apache/incubator-kie-issues#1986] Forcing runtime read 
of config (#3989)
56a70ed754 is described below

commit 56a70ed7543473f4d8305ce34b432122ca0da8e2
Author: Francisco Javier Tirado Sarti 
<[email protected]>
AuthorDate: Mon Jul 21 16:35:56 2025 +0200

    [Fix apache/incubator-kie-issues#1986] Forcing runtime read of config 
(#3989)
---
 .../quarkus/workflows/ConversationFlowIT.java      |  2 --
 .../runtime/RestClientBuilderFactory.java          | 33 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git 
a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ConversationFlowIT.java
 
b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ConversationFlowIT.java
index 533aaf110b..9d18e18b13 100644
--- 
a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ConversationFlowIT.java
+++ 
b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ConversationFlowIT.java
@@ -21,7 +21,6 @@ package org.kie.kogito.quarkus.workflows;
 import java.util.Map;
 
 import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 import io.quarkus.test.common.QuarkusTestResource;
@@ -35,7 +34,6 @@ import static org.hamcrest.CoreMatchers.notNullValue;
 
 @QuarkusTestResource(OperationsMockService.class)
 @QuarkusIntegrationTest
-@Disabled("Disabled due to bug 
https://github.com/quarkusio/quarkus/issues/46801. When issues are resolved, we 
need to reenable.")
 class ConversationFlowIT {
 
     @BeforeAll
diff --git 
a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow/src/main/java/io/quarkus/restclient/runtime/RestClientBuilderFactory.java
 
b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow/src/main/java/io/quarkus/restclient/runtime/RestClientBuilderFactory.java
index 31cfbcf46e..69ee3c0435 100644
--- 
a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow/src/main/java/io/quarkus/restclient/runtime/RestClientBuilderFactory.java
+++ 
b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow/src/main/java/io/quarkus/restclient/runtime/RestClientBuilderFactory.java
@@ -18,6 +18,8 @@
  */
 package io.quarkus.restclient.runtime;
 
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Optional;
 
 import org.eclipse.microprofile.config.ConfigProvider;
@@ -30,8 +32,11 @@ import io.quarkus.arc.InstanceHandle;
 
 public class RestClientBuilderFactory extends RestClientBase {
 
+    private String configKey;
+
     public RestClientBuilderFactory(Class<?> proxyType, String 
baseUriFromAnnotation, String configKey) {
         super(proxyType, baseUriFromAnnotation, configKey, new Class[0]);
+        this.configKey = configKey;
     }
 
     public static RestClientBuilder build(Class<?> restClass) {
@@ -63,4 +68,32 @@ public class RestClientBuilderFactory extends RestClientBase 
{
         return builder;
     }
 
+    private final static String URL_PROPERTY_QUOTES = 
"quarkus.rest-client.\"%s\".url";
+    private final static String URL_PROPERTY = "quarkus.rest-client.%s.url";
+
+    private static Optional<String> getProperty(String property, String 
configKey) {
+        return 
ConfigProvider.getConfig().getOptionalValue(String.format(property, configKey), 
String.class);
+    }
+
+    @Override
+    protected void configureBaseUrl(RestClientBuilder builder) {
+        oneOf(getProperty(URL_PROPERTY_QUOTES, configKey), 
getProperty(URL_PROPERTY, configKey))
+                .ifPresentOrElse(baseUrl -> {
+                    try {
+                        builder.baseUrl(new URL(baseUrl));
+                    } catch (MalformedURLException e) {
+                        throw new IllegalArgumentException("The value of URL 
property was invalid " + baseUrl, e);
+                    }
+                }, () -> super.configureBaseUrl(builder));
+    }
+
+    @SafeVarargs
+    private static <T> Optional<T> oneOf(Optional<T>... optionals) {
+        for (Optional<T> o : optionals) {
+            if (o.isPresent()) {
+                return o;
+            }
+        }
+        return Optional.empty();
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to