Skip to content
Discussion options

You must be logged in to vote

You would need to build the client programmatically injecting the baseUri from the application config. For example:

application.properties:

my.services=http://server:port/x/toggle,http://server:port/y/toggle

creating the client programmatically:

@ConfigProperty("my.services")
List<String> myServices;

List<ExampleService> services;

public void setup() {
  for (String myService : myServices) {
     services.add(RestClientBuilder.newBuilder()
            .baseUri(URI.create(myService))
            .build(ExampleService.class));
  } 
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Sgitario
Comment options

Sgitario May 3, 2023
Collaborator

Answer selected by radcortez
@cescoffier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants