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

@All like annotation for gRPC clients #45497

Open
LarsSven opened this issue Jan 10, 2025 · 2 comments
Open

@All like annotation for gRPC clients #45497

LarsSven opened this issue Jan 10, 2025 · 2 comments
Labels
area/grpc gRPC kind/enhancement New feature or request

Comments

@LarsSven
Copy link
Contributor

Description

Feature request

I would love to have an annotation similar to @ALL for @Inject that generates a map/list of all gRPC clients defined in the application.properties. So if we defined an application.yml as follows:

quarkus:
  grpc:
    clients:
      container-runtime:
        ...
      executable-runtime:
        ...

Doing something like

@GrpcClients
Map<String, ActionService> clients

Would generate a map of name to client.

Use case

To exemplify why this may be useful, we essentially have a microservice that receives an execution graph of requests that should be sent to some gRPC servers. The microservice itself does not care about which gRPC servers there are, it just gets the name of the server as part of the requests. In order to implement this, we currently need to hardcode every server using @GrpcClient, which means that if we need to add another gRPC server, we need to release a new application version of the microservice, since all available gRPC servers are hardcoded in the code. Instead, it would be much nicer to just deploy the new gRPC server, update the application.yml with the host/port of the new server, without needing to update the source code. But for that, we need to dynamically retrieve all gRPC clients from the application config.

Implementation ideas

No response

@LarsSven LarsSven added the kind/enhancement New feature or request label Jan 10, 2025
@quarkus-bot quarkus-bot bot added the area/grpc gRPC label Jan 10, 2025
Copy link

quarkus-bot bot commented Jan 10, 2025

/cc @alesj (grpc), @cescoffier (grpc)

@cescoffier
Copy link
Member

We could provide the names, but we cannot rely on CDI because they all use different interfaces.
Actually, you might be able to inject all the Bindable beans. @alesj WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc gRPC kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants