Commit 1c608454 authored by Rustam Lotsmanenko (EPAM)'s avatar Rustam Lotsmanenko (EPAM)
Browse files

fix shutdown npe

parent 758ecef6
Pipeline #63952 passed with stages
in 6 minutes
......@@ -139,9 +139,11 @@ public class GcpEventPublisher implements IEventPublisher {
@PreDestroy
public void shutDownPublisher() throws InterruptedException {
log.debug("Shutting down publisher on exit, await termination duration: {} seconds", eventMessagingPropertiesConfig.getShutdownDuration());
publisher.shutdown();
publisher.awaitTermination(eventMessagingPropertiesConfig.getShutdownDuration(), TimeUnit.SECONDS);
if (Objects.nonNull(this.publisher)) {
log.debug("Shutting down publisher on exit, await termination duration: {} seconds", eventMessagingPropertiesConfig.getShutdownDuration());
publisher.shutdown();
publisher.awaitTermination(eventMessagingPropertiesConfig.getShutdownDuration(), TimeUnit.SECONDS);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment