From d630066ed0b7b0627a38603d86ac9a18569954dc Mon Sep 17 00:00:00 2001 From: askhat-abishev Date: Tue, 8 Oct 2024 18:08:30 +0500 Subject: [PATCH] MODINV-1073: Rename topic "linked-data.instance-ingress" to "inventory.instance_ingress" --- README.MD | 2 ++ .../folio/inventory/InstanceIngressConsumerVerticle.java | 3 ++- .../inventory/services/InventoryKafkaTopicService.java | 8 +++++++- .../inventory/service/KafkaAdminClientServiceTest.java | 6 ++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.MD b/README.MD index ca9d74c41..759c4bed7 100644 --- a/README.MD +++ b/README.MD @@ -127,6 +127,8 @@ After setup, it is good to check logs in all related modules for errors. * DI_INVENTORY_AUTHORITY_CREATED_READY_FOR_POST_PROCESSING_PARTITIONS * DI_INVENTORY_AUTHORITY_UPDATED_READY_FOR_POST_PROCESSING_PARTITIONS * DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS + * INVENTORY_INSTANCE_INGRESS_PARTITIONS + Default value for all partitions is 1 ## Properties diff --git a/src/main/java/org/folio/inventory/InstanceIngressConsumerVerticle.java b/src/main/java/org/folio/inventory/InstanceIngressConsumerVerticle.java index 410218aaf..37937d82b 100644 --- a/src/main/java/org/folio/inventory/InstanceIngressConsumerVerticle.java +++ b/src/main/java/org/folio/inventory/InstanceIngressConsumerVerticle.java @@ -10,8 +10,9 @@ public class InstanceIngressConsumerVerticle extends KafkaConsumerVerticle { + public static final String INSTANCE_INGRESS_TOPIC = "inventory.instance_ingress"; + private static final Logger LOGGER = LogManager.getLogger(InstanceIngressConsumerVerticle.class); - private static final String INSTANCE_INGRESS_TOPIC = "linked-data.instance-ingress"; private static final String BASE_PROPERTY = "InstanceIngressConsumerVerticle"; @Override diff --git a/src/main/java/org/folio/inventory/services/InventoryKafkaTopicService.java b/src/main/java/org/folio/inventory/services/InventoryKafkaTopicService.java index 60458fb2e..4afbd8e0c 100644 --- a/src/main/java/org/folio/inventory/services/InventoryKafkaTopicService.java +++ b/src/main/java/org/folio/inventory/services/InventoryKafkaTopicService.java @@ -20,6 +20,7 @@ import static org.folio.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_MATCHED; import static org.folio.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_MODIFIED; import static org.folio.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_NOT_MATCHED; +import static org.folio.inventory.InstanceIngressConsumerVerticle.INSTANCE_INGRESS_TOPIC; import org.folio.kafka.services.KafkaTopic; @@ -45,7 +46,8 @@ public KafkaTopic[] createTopicObjects() { new InventoryKafkaTopic(DI_INVENTORY_HOLDINGS_CREATED_READY_FOR_POST_PROCESSING.value(), holdingCreatedReadyForPostProcessingPartitions()), new InventoryKafkaTopic(DI_INVENTORY_AUTHORITY_CREATED_READY_FOR_POST_PROCESSING.value(), authorityCreatedReadyForPostProcessingPartitions()), new InventoryKafkaTopic(DI_INVENTORY_AUTHORITY_UPDATED_READY_FOR_POST_PROCESSING.value(), authorityUpdatedReadyForPostProcessingPartitions()), - new InventoryKafkaTopic(DI_SRS_MARC_BIB_RECORD_MODIFIED.value(), marcBibRecordModifiedPartitions()) + new InventoryKafkaTopic(DI_SRS_MARC_BIB_RECORD_MODIFIED.value(), marcBibRecordModifiedPartitions()), + new InventoryKafkaTopic(INSTANCE_INGRESS_TOPIC, instanceIngressPartitions()) }; } @@ -128,4 +130,8 @@ private Integer marcBibRecordModifiedPartitions() { return Integer.valueOf(firstNonBlank(System.getenv( "DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS"), "1")); } + + private Integer instanceIngressPartitions() { + return Integer.valueOf(firstNonBlank(System.getenv("INVENTORY_INSTANCE_INGRESS_PARTITIONS"), "1")); + } } diff --git a/src/test/java/org/folio/inventory/service/KafkaAdminClientServiceTest.java b/src/test/java/org/folio/inventory/service/KafkaAdminClientServiceTest.java index 1df518f0c..2ffe14f64 100644 --- a/src/test/java/org/folio/inventory/service/KafkaAdminClientServiceTest.java +++ b/src/test/java/org/folio/inventory/service/KafkaAdminClientServiceTest.java @@ -68,7 +68,8 @@ public void setUp() { new InventoryKafkaTopic("DI_INVENTORY_HOLDINGS_CREATED_READY_FOR_POST_PROCESSING", 1), new InventoryKafkaTopic("DI_INVENTORY_AUTHORITY_CREATED_READY_FOR_POST_PROCESSING", 1), new InventoryKafkaTopic("DI_INVENTORY_AUTHORITY_UPDATED_READY_FOR_POST_PROCESSING", 1), - new InventoryKafkaTopic("DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS", 1) + new InventoryKafkaTopic("DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS", 1), + new InventoryKafkaTopic("inventory.instance_ingress", 1) }; @@ -174,6 +175,7 @@ private Future createKafkaTopicsAsync(KafkaAdminClient client) { "folio.Default.foo-tenant.DI_INVENTORY_HOLDINGS_CREATED_READY_FOR_POST_PROCESSING", "folio.Default.foo-tenant.DI_INVENTORY_AUTHORITY_CREATED_READY_FOR_POST_PROCESSING", "folio.Default.foo-tenant.DI_INVENTORY_AUTHORITY_UPDATED_READY_FOR_POST_PROCESSING", - "folio.Default.foo-tenant.DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS" + "folio.Default.foo-tenant.DI_SRS_MARC_BIB_RECORD_MODIFIED_PARTITIONS", + "folio.Default.foo-tenant.inventory.instance_ingress" ); }