How to simulate various network scenarios? (in Java)

We create a client server application that should work around the clock. Applications are designed to detect network failures (using a heartbeat) and connect to the server as soon as possible.

The first test I did was just stop the client or server, and then start again, and everything works fine. I am wondering if there are any tools that can help me simulate congestion, delays or a more realistic problem than just unplugging my Ethernet cable.

+3
source share
2 answers

Does the application use simple tcp sockets? Or does he use HTTP / HTTPS? If its based on HTTP, Fiddler (as well as some other proxy servers) has the ability to simulate slow connection speeds, although at the expense of only windows.

Alternatively, I had a good experience with tools like Apache TCPMon and ilk . They can pretty well mimic congestion and line breaks, although, in my experience, you will still find new and interesting failure modes in the real world.

+3
source

Sniffy Java- - ConnectException , .

-javaagent:sniffy.jar=5559 JVM localhost:5559 - - , .

Sniffy connections console

( 3.1.3) , .

: Sniffy

0

Source: https://habr.com/ru/post/1713664/


All Articles