You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented a kafka streams application. And by the confluent example created a shutdown hook for the gracefully shutdown.
final Topology topology = buildTopology();
KafkaStreams kafkaStreams = new KafkaStreams(topology, properties);
kafkaStreams.start();
Runtime.getRuntime().addShutdownHook(new Thread(kafkaStreams::close));
This is working good. But from the other side I have a sonar cube complaining for the issue that I should create KafkaStreams using try-with-resources. But in this case kafka streams closed and isn't listening events. As I now in prevoious versions KafkaStreams didn't implement Autoclosable interface. What could you suggest to use gracefully shutdown and to avoid a sonar complaining? Or should I use gracefully shutdown and try-with-resources both?
The text was updated successfully, but these errors were encountered:
I implemented a kafka streams application. And by the confluent example created a shutdown hook for the gracefully shutdown.
This is working good. But from the other side I have a sonar cube complaining for the issue that I should create KafkaStreams using try-with-resources. But in this case kafka streams closed and isn't listening events. As I now in prevoious versions KafkaStreams didn't implement Autoclosable interface. What could you suggest to use gracefully shutdown and to avoid a sonar complaining? Or should I use gracefully shutdown and try-with-resources both?
The text was updated successfully, but these errors were encountered: