Skip to content

Commit

Permalink
Close the pulsar and Kafka topic handlers safely.
Browse files Browse the repository at this point in the history
Signed-off-by: Keshava Munegowda <keshava.gowda@gmail.com>
  • Loading branch information
kmgowda committed Feb 1, 2020
1 parent 925c47e commit e192f42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion driver-kafka/src/main/java/io/sbk/Kafka/Kafka.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public void openStorage(final Parameters params) throws IOException {

@Override
public void closeStorage(final Parameters params) throws IOException {
topicHandler.close();
if (topicHandler != null) {
topicHandler.close();
}
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions driver-pulsar/src/main/java/io/sbk/Pulsar/Pulsar.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public void openStorage(final Parameters params) throws IOException {

@Override
public void closeStorage(final Parameters params) throws IOException {
if (topicHandler != null) {
topicHandler.close();
}
}

@Override
Expand Down

0 comments on commit e192f42

Please sign in to comment.