I would suggest to create a bean for RestClient client; When spring load bean properly while starting the app.
@Bean
RestClient client() {
return RestClient.builder().baseUrl(url).build();
}
and use the bean in service directly instead of setting the url in service class