Skip to content

Commit

Permalink
Merge pull request #34 from kmgowda/kmg-pulsar-close
Browse files Browse the repository at this point in the history
Close the pulsar and Kafka topic handlers safely.
  • Loading branch information
kmgowda authored Feb 1, 2020
2 parents 925c47e + e192f42 commit 042b4c7
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 042b4c7

Please sign in to comment.