Hello Community,
My developers use the IntelliJ IDE to develop, as our environment is 100% cloud, we use NPA to access the development environments. We use spring as a framework for our applications.
My error is the following for some endpoints I simply cannot connect using IntelliJ and spring. If I do a curl or telnet I can access the endpoint normally, only IntelliJ and spring can't. I have openVPN as redundancy and I don't get this error.
Has anyone had a similar problem?
Below is a simpler application that I can replicate the error
package ConnectivityTest;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.reactive.ClientHttpConnector;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.web.reactive.function.client.ExchangeStrategies;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.netty.http.client.HttpClient;
public class ConnectivityTest {
public static <ObjeresponseEntityct> void main(String[] args) {
HttpClient httpClient = HttpClient.create().wiretap(true); // wiretap(true) é opcional, usado para depuração
ClientHttpConnector connector = new ReactorClientHttpConnector(httpClient);
ExchangeStrategies strategies = ExchangeStrategies.builder()
.codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(1024 * 1024)) // Ajuste o limite de 1MB (1024 * 1024 bytes)
.build();
WebClient client = WebClient.builder()
.clientConnector(connector)
.exchangeStrategies(strategies)
.build();
String url = "https://xxxxxx";
client.get()
.uri(url)
.header("Authorization", "Basic dGVzdDp0ZXN0")
.retrieve()
.toEntity(String.class)
.block(); // Bloqueia a execução até que a resposta seja recebida
ResponseEntity<ObjeresponseEntityct> responseEntity = null;
System.out.println("Response Code: " + responseEntity.getStatusCodeValue());
System.out.println("Response Body: " + responseEntity.getBody());
}
}
Caused by: io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Failed to resolve 'xxxxxxx' and search domain query for configured domains failed as well: bbrouter]