A configuration key names a client so its settings can be supplied outside the client interface. In a Quarkus service, this replaces a hardcoded endpoint URL with a property in application.properties. The annotation names the client; the property uses that name to identify which client receives the URL. section 11.1.1 section 4.5.4
Move a REST client URL into configuration
Change @RegisterRestClient(baseUri = "http://localhost:8081") to @RegisterRestClient(configKey = "reservations"). Then set quarkus.rest-client.reservations.url=http://localhost:8081 in application.properties. The URL remains local for now, but it is no longer fixed in the interface. section 11.1.1
Name a GraphQL client
Annotate the typesafe client interface with @GraphQLClientApi(configKey = "inventory") and set quarkus.smallrye-graphql-client.inventory.url=http://localhost:8083/graphql. The name can also identify the client at injection with @GraphQLClient("inventory"). Distinct names allow multiple GraphQL client APIs to have different settings. section 4.5.4
For a REST client, a custom name is optional: the interface’s fully qualified name can serve as the default configuration key. A custom name avoids tying the property to a class name or package that may change. Moving a URL into application.properties does not itself make a localhost address usable in the cloud; that endpoint still needs to be changed for deployment. section 11.1.1
