From cdf07a9d425f7c87395b07b0deccc7515bff9ee7 Mon Sep 17 00:00:00 2001 From: Oleksandr Vidinieiev Date: Wed, 7 Apr 2021 14:59:15 +0300 Subject: [PATCH] [MODPUBSUB-158] Initialize headers map when registering subscribers during module initialization (cherry picked from commit 2cef43d1e8392ae95e59c64eb1ea1bf7ff8c4183) --- .../main/java/org/folio/services/impl/StartupServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod-pubsub-server/src/main/java/org/folio/services/impl/StartupServiceImpl.java b/mod-pubsub-server/src/main/java/org/folio/services/impl/StartupServiceImpl.java index ed4814b6..00caa1b9 100644 --- a/mod-pubsub-server/src/main/java/org/folio/services/impl/StartupServiceImpl.java +++ b/mod-pubsub-server/src/main/java/org/folio/services/impl/StartupServiceImpl.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import java.util.Collections; +import java.util.HashMap; import static org.folio.rest.jaxrs.model.MessagingModule.ModuleRole.SUBSCRIBER; @@ -45,6 +46,7 @@ public void initSubscribers() { OkapiConnectionParams params = new OkapiConnectionParams(vertx); params.setOkapiUrl(kafkaConfig.getOkapiUrl()); params.setTenantId(messagingModule.getTenantId()); + params.setHeaders(new HashMap<>()); kafkaTopicService.createTopics(Collections.singletonList(messagingModule.getEventType()), messagingModule.getTenantId()) .compose(ar -> consumerService.subscribe(Collections.singletonList(messagingModule.getEventType()), params)); });