protected StreamAppenderMetrics getMetrics(MetricsRegistryMap metricsRegistry) {
    return new StreamAppenderMetrics(getName(), metricsRegistry);
  }
force the system producer to flush the messages
samza-log4j2/src/main/java/org/apache/samza/logging/log4j2/StreamAppender.java