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

Invalid quarkus.unleash.url generated for shared Dev Services container scenario #271

Open
matjazs opened this issue Jun 23, 2024 · 0 comments

Comments

@matjazs
Copy link

matjazs commented Jun 23, 2024

If the Unleash devservice is started after the same devservice has been initiated in another Quarkus app, the UnleashDevServiceProcessor generates a different quarkus.unleash.url compared to when an existing Unleash container is not found.

When the container is actually started by the processor, the URL built below is passed to the config map:

public String getUrl() {
    return String.format("http://%s:%d/api", this.getUnleashHost(), this.getPort());
}

However, when an existing container is found, the container address in the form localhost:port is passed to the config map:

return maybeContainerAddress
        .map(containerAddress -> new UnleashRunningDevService(FEATURE_NAME,
                containerAddress.getId(),
                null, configMap(containerAddress.getUrl(), null)))
        .orElseGet(defaultUnleashSupplier);

The latter causes the Unleash API is not a valid URL: localhost:4242 error because "localhost" is not a valid protocol when creating client URLs.

A workaround is to explicitly configure the quarkus.unleash.url for the shared container scenario, but this involves changing the configuration each time the startup order of the Quarkus apps changes.

For comparison, the Keycloak devservice allows for configuring the two applications so that when container sharing is active, no additional changes are needed in either application regardless of the startup order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant