[ https://issues.apache.org/jira/browse/KAFKA-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15853657#comment-15853657 ]
Enrico Olivelli commented on KAFKA-1101: ---------------------------------------- I run embedded Kafka too, the fact the it calls System.exit for production is OK for me but for JUnit tests it is very annoying because the JVM exits and JUnit cannot work cleanly and Maven Surefire Plugin breaks with a "java.lang.RuntimeException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?" message. Is it possible to create a "callback" function to be called with a default implementation of System.exit(1) ?? Do I need to create a specific JIRA or a KIP for this ? > Need better java api for embedding kafkaserver in a java container app > ---------------------------------------------------------------------- > > Key: KAFKA-1101 > URL: https://issues.apache.org/jira/browse/KAFKA-1101 > Project: Kafka > Issue Type: Bug > Reporter: Jason Rosenberg > > We embed the KafkaServer inside a java service container framework, which > makes it easy to deploy and monitor within our infrastructure. When > upgrading to kafka 0.8 from 0.7.2, I ran into an issue with not being able to > pass the needed constructor arg (SystemTime), since there doesn't appear to > be an easy way to instantiate that from java. So, I ended up with this janky > solution using SystemTime$.MODULE$. > Could a default constructor be added which assumes a default SystemTime, > rather than requiring that here? > Note, I need to construct a KafkaServer directly, since I need to manage the > lifecycle more directly than can be done with KafkaServerStartable. > {code} > // Need to do janky scala MODULE$ dereferencing, in order to get a > default value in ctor > server = new kafka.server.KafkaServer(kafkaConfig, SystemTime$.MODULE$); > server.startup(); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)