Skip to content

Commit 5024a77

Browse files
committed
GH-777: Reset running on stop()
Fixes #777 So that `isRunning()` properly reflects the state. In future, consider removing `Lifecycle` and close the producer(s) with a `ContextStoppedEvent`.
1 parent ad4214d commit 5024a77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public void start() {
189189
public void stop() {
190190
try {
191191
destroy();
192+
this.running = false;
192193
}
193194
catch (Exception e) {
194195
logger.error("Exception while closing producer", e);

0 commit comments

Comments
 (0)