2026-06-17T11:17:19.608+05:30 ERROR 7436 --- [Eureka] [get_localhost-5] c.n.e.cluster.ReplicationTaskProcessor : Network level connection to peer localhost; retrying after delay
jakarta.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: getsockopt
i get this log whenever i start a service that tries to register itself with eureka, earlier i thought iwas getting this because of restclient call with wrong config so i changed it to:
@Configuration
@Slf4j
public class RestClientConfig {
@Bean("loadBalancedBuilder")
@LoadBalanced
public RestClient.Builder loadBalancedRestClientBuilder() {
log.info("LoadBalancedRestClientBuilder");
return RestClient.builder();
}
@Bean("defaultBuilder")
@Primary
public RestClient.Builder restClientBuilder() {
log.info("RestClientBuilder");
return RestClient.builder();
}
}
now restclient call works (it uses service name from eureka), kafka works but i also added api-gateway which only work for following config:
id: user-service
predicates:
- Path=/user/**
uri: http://localhost:8081 #and not lb://USER-SERVICE
what could be the reason, all service using restclient are already using proper config for restclient so what now?