2 Respuestas
- Más nuevo
- Más votos
- Más comentarios
0
Yes both the subnets are public, I initially followed the docs and tried with a public subnet and a private subnet along with NAT. It showed same issue.
respondido hace 8 meses
-1
ok, I wrote a small java code making api call,
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class TodoClient {
public static void main(String[] args) {
sampleCall();
}
public static void sampleCall() {
try {
URL url = new URL("https://jsonplaceholder.typicode.com/todos/1");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
int responseCode = connection.getResponseCode();
System.out.println("Response Code: " + responseCode);
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
StringBuilder response = new StringBuilder();
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
System.out.println("Response Data:");
System.out.println(response.toString());
} else {
System.out.println("Failed to fetch data. Response code: " + responseCode);
}
// Close the connection
connection.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
executed on all the machines, the code was giving correct ouput, when similar code was running in an msk connector, it threw me Connection Timeout error.
respondido hace 8 meses
Contenido relevante
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace un año
ping is not a valid test as it uses ICMP. Make sure you can connect to the internet on port 443.