private boolean hasPendingTransactionalRequests() {
        return transactionManager != null && transactionManager.hasPendingRequests() && transactionManager.hasOngoingTransaction();
    }
Get the in-flight batches that has reached delivery timeout.
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java