Skip to content

Commit e7a1206

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 a7f75ae commit e7a1206

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public void start() {
176176
public void stop() {
177177
try {
178178
destroy();
179+
this.running = false;
179180
}
180181
catch (Exception e) {
181182
logger.error("Exception while closing producer", e);

0 commit comments

Comments
 (0)