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

Fix a few issues with the local proxy for REST Client feature #43311

Merged
merged 2 commits into from
Sep 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void determineRequiredProxies(RestClientsBuildTimeConfig restClientsBuild
for (var configEntry : configs.entrySet()) {
if (!configEntry.getValue().enableLocalProxy()) {
log.trace("Ignoring config key: '" + configEntry.getKey() + "' because enableLocalProxy is false");
break;
continue;
}

String configKey = configEntry.getKey();
Expand All @@ -91,7 +91,7 @@ public void determineRequiredProxies(RestClientsBuildTimeConfig restClientsBuild

if (baseUri.isEmpty()) {
log.debug("Unable to determine uri or url for config key '" + configKey + "'");
break;
continue;
}
producer.produce(new RestClientHttpProxyBuildItem(matchingBI.getClassInfo().name().toString(), baseUri.get(),
configEntry.getValue().localProxyProvider()));
Expand All @@ -101,14 +101,14 @@ public void determineRequiredProxies(RestClientsBuildTimeConfig restClientsBuild
if (classInfo == null) {
log.debug(
"Key '" + configKey + "' could not be matched to either a class name or a REST Client's configKey");
break;
continue;
}
Optional<String> baseUri = oneOf(
Optional.ofNullable(restClientValues.get("uri")),
Optional.ofNullable(restClientValues.get("url")));
if (baseUri.isEmpty()) {
log.debug("Unable to determine uri or url for config key '" + configKey + "'");
break;
continue;
}
producer.produce(new RestClientHttpProxyBuildItem(classInfo.name().toString(), baseUri.get(),
configEntry.getValue().localProxyProvider()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ public <T> T build(Class<T> aClass) throws IllegalStateException, RestClientDefi
RestClientsConfig restClients = config.getConfigMapping(RestClientsConfig.class);

// support overriding the URI from the override-uri property
Optional<String> maybeOverrideUri = restClients.getClient(aClass).overrideUri();
var overrideUrlKeyName = String.format("quarkus.rest-client.\"%s\".override-uri", aClass.getName());
Optional<String> maybeOverrideUri = config.getOptionalValue(overrideUrlKeyName, String.class);
if (maybeOverrideUri.isPresent()) {
uri = URI.create(maybeOverrideUri.get());
}
Expand Down
Loading