static String stripSuffix(String str, String suffix) {
        if (str.endsWith(suffix)) {
            return str.substring(0, str.length() - suffix.length());
        } else {
            throw new RuntimeException("String " + str + " does not end with the " +
                "expected suffix " + suffix);
        }
    }
The Jackson serializer we use for JSON objects.
generator/src/main/java/org/apache/kafka/message/MessageGenerator.java