FIX Antenna Java provides API, which helps to detect problems with consumer communication. Sometimes it may be useful to apply different strategies in application to handle consumer with slow communication abilities.

To enable this functionality you have to set few options for FIX session: 

SessionParameters details = new SessionParameters();
...
//Enable slow consumer detection logic
details.getConfiguration().setProperty(Configuration.SLOW_CONSUMER_DETECTION_ENABLED, "true");

// Define maximum timeframe for sending FIX message to cient in milliseconds
details.getConfiguration().setProperty(Configuration.SLOW_CONSUMER_WRITE_DELAY_THRESHOLD, "50");


Also, it needs to register a handler of FIXSessionSlowConsumerListener type for processing notification about detected sending problems. FIXSessionSlowConsumerListener interface has a single method with 3 parameters: reason, expectedValue, currentValue.

FIX Antenna notifies about two suspicious cases during messages sending:

session.setSlowConsumerListener((reason, expectedValue, currentValue) -> {
    switch (reason) {
        case TRANSPORT_WRITE_DELAY:
            System.out.println("Writes a message too long - " + currentValue);
            break;
        case TRANSPORT_WRITE_NOT_COMPLETE:
            System.out.println("Consumer can't get whole message package - " + currentValue);
            break;
    }
});