Skip to content
Closed
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
Empty file modified .ci/environments/common/update_quarkus.sh
100755 → 100644
Empty file.
Empty file modified .ci/environments/update.sh
100755 → 100644
Empty file.
Empty file modified .ci/jenkins/dsl/test.sh
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

public abstract class AbstractKogitoAddonsQuarkusDataIndexProcessor extends OneOfCapabilityKogitoAddOnProcessor {
private static final String QUARKUS_HTTP_PORT = "quarkus.http.port";
private static final String QUARKUS_HTTP_ROOT_PATH = "quarkus.http.root-path";
private static final String KOGITO_SERVICE_URL_PROP = "kogito.service.url";
private static final String KOGITO_DATA_INDEX_PROP = "kogito.data-index.url";
/**
Expand All @@ -61,7 +62,8 @@ public void buildDefaultDataIndexURLSystemProperty(BuildProducer<SystemPropertyB
// Setting a default `kogito.data-index.url` accordingly to the runtime url.
String dataIndexUrl = ConfigProvider.getConfig().getOptionalValue(KOGITO_SERVICE_URL_PROP, String.class).orElseGet(() -> {
Integer port = ConfigProvider.getConfig().getOptionalValue(QUARKUS_HTTP_PORT, Integer.class).orElse(8080);
return "http://localhost:" + port;
String rootPath = ConfigProvider.getConfig().getOptionalValue(QUARKUS_HTTP_ROOT_PATH, String.class).orElse("");
return "http://localhost:" + port + rootPath;
});
systemProperties.produce(new SystemPropertyBuildItem(KOGITO_DATA_INDEX_PROP, dataIndexUrl));
}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

@Configuration
public class DataIndexURLConfiguration {
private static final String CONTEXT_PATH = "server.servlet.context-path";
private static final String KOGITO_DATA_INDEX_URL_PROP = "kogito.data-index.url";
private static final String KOGITO_DATAINDEX_HTTP_URL_PROP = "kogito.dataindex.http.url";

Expand All @@ -44,6 +45,9 @@ public class DataIndexURLConfiguration {
@Value("${kogito.service.url:null}")
String kogitoServiceUrl;

@Value("${server.servlet.context-path:''}")
String contextPath;

@Autowired
ConfigurableEnvironment environment;

Expand All @@ -58,13 +62,14 @@ public void initDataIndexDefaultURl() {
Properties properties = new Properties();
properties.put(KOGITO_DATA_INDEX_URL_PROP, dataIndexUrl);
properties.put(KOGITO_DATAINDEX_HTTP_URL_PROP, dataIndexUrl);
properties.put(CONTEXT_PATH, contextPath);
propertySources.addLast(new PropertiesPropertySource("data-index-url", properties));
}

private String resolveDataIndexURL(ConfigurableEnvironment environment) {

if (kogitoServiceUrl == null) {
return "http://" + serverAddress + ":" + serverPort;
return "http://" + serverAddress + ":" + serverPort + contextPath;
}
return kogitoServiceUrl;
}
Expand Down
Empty file.
Empty file.
Empty file.