Skip to content

Unable to inject a RestClient into a Stork ServiceDiscoveryProvider #51674

@jmcconnell

Description

@jmcconnell

Describe the bug

In order to implement a custom ServiceDiscoveryProvider, we would like to @Inject a RestClient for the discovery service we are hitting. However, instantiation of our ServiceDiscoveryProvider fails during Stork initialization because the presence of the RestClient causes Quarkus to try to initialize the StorkClientRequestFilter, which expects Stork to previously have been initialized. Our discovery service RestClient is not dependent on Stork, as the host is supplied via environment variables.

Expected behavior

In older Quarkus versions, this setup worked fine. Expected behavior would be that the ServiceDiscoveryProvider is instantiated with a RestClient built to hit the host supplied via environment variables.

Actual behavior

Instantiation of the ServiceDiscoveryProvider fails because the StorkClientRequestFilter throws an exception stating:

Trying to use a StorkClientRequestFilter but the quarkus-smallrye-stork extension is missing, please add the extension.

How to Reproduce?

Steps to reproduce with the provided reproducer:

  1. unzip stork-quickstart.zip
  2. cd stork-quickstart/
  3. mvn test

The test will fail with the "quarkus-smallrye-stork extension is missing" message, which is misleading. If you comment out the Client declaration from PipelineServiceDiscoveryProvider, you will no longer see that message. (The test will still fail with an expected error about the client not being properly configured.)

stork-quickstart.zip

Output of uname -a or ver

Darwin M-CWY0Q2275W 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64

Output of java -version

openjdk version "21.0.9" 2025-10-21 LTS OpenJDK Runtime Environment Corretto-21.0.9.10.1 (build 21.0.9+10-LTS) OpenJDK 64-Bit Server VM Corretto-21.0.9.10.1 (build 21.0.9+10-LTS, mixed mode, sharing)

Quarkus version or git rev

3.27.1

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.11

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions