From d7017058680c7ef4c3c888062b11c76ab714df38 Mon Sep 17 00:00:00 2001 From: aliaksandr_fedasiuk Date: Fri, 15 Nov 2024 02:48:52 +0500 Subject: [PATCH] MODSOURMAN-1246: removing extra changes --- ...ataImportJournalBatchConsumerVerticle.java | 36 +++++++++++++++++-- .../src/main/resources/log4j2.properties | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/mod-source-record-manager-server/src/main/java/org/folio/verticle/DataImportJournalBatchConsumerVerticle.java b/mod-source-record-manager-server/src/main/java/org/folio/verticle/DataImportJournalBatchConsumerVerticle.java index 2ecf9499c..047a48dcc 100644 --- a/mod-source-record-manager-server/src/main/java/org/folio/verticle/DataImportJournalBatchConsumerVerticle.java +++ b/mod-source-record-manager-server/src/main/java/org/folio/verticle/DataImportJournalBatchConsumerVerticle.java @@ -54,7 +54,37 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.folio.rest.jaxrs.model.DataImportEventTypes.*; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_COMPLETED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_ERROR; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_AUTHORITY_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_AUTHORITY_UPDATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_HOLDING_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_HOLDING_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_HOLDING_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_HOLDING_UPDATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_INSTANCE_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_INSTANCE_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_INSTANCE_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_INSTANCE_UPDATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_ITEM_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_ITEM_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_ITEM_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVENTORY_ITEM_UPDATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_INVOICE_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_LOG_SRS_MARC_AUTHORITY_RECORD_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_LOG_SRS_MARC_BIB_RECORD_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_ORDER_CREATED_READY_FOR_POST_PROCESSING; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_AUTHORITY_RECORD_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_AUTHORITY_RECORD_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_MODIFIED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_MODIFIED_READY_FOR_POST_PROCESSING; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_BIB_RECORD_UPDATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_HOLDINGS_RECORD_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_HOLDINGS_RECORD_NOT_MATCHED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_HOLDINGS_RECORD_UPDATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_SRS_MARC_HOLDING_RECORD_CREATED; +import static org.folio.rest.jaxrs.model.DataImportEventTypes.DI_MARC_FOR_UPDATE_RECEIVED; import static org.folio.services.RecordsPublishingServiceImpl.RECORD_ID_HEADER; import static org.folio.services.util.EventHandlingUtil.constructModuleName; import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE; @@ -217,11 +247,11 @@ private Flowable, Collection>> lis String recordId = okapiConnectionParams.getHeaders().get(RECORD_ID_HEADER); JournalEvent event = DatabindCodec.mapper().readValue(consumerRecord.value(), JournalEvent.class); - LOGGER.debug("listenKafkaEvents:: Event was received with recordId: {} event type: {}", recordId, event.getEventType()); + LOGGER.debug("handle:: Event was received with recordId: {} event type: {}", recordId, event.getEventType()); // Successfully create and return a Bundle object containing the record and event details return Optional.of(new Bundle(consumerRecord, event, okapiConnectionParams)); } catch (Exception e) { - LOGGER.error("listenKafkaEvents:: Error processing Kafka event with exception: {}", e.getMessage()); + LOGGER.error("Error processing Kafka event with exception: {}", e.getMessage()); // Return empty Optional to skip this record and continue processing return Optional.empty(); } diff --git a/mod-source-record-manager-server/src/main/resources/log4j2.properties b/mod-source-record-manager-server/src/main/resources/log4j2.properties index 69ab5f6c7..8e785b369 100644 --- a/mod-source-record-manager-server/src/main/resources/log4j2.properties +++ b/mod-source-record-manager-server/src/main/resources/log4j2.properties @@ -18,7 +18,7 @@ logger.folio_kafka.level = debug logger.folio_kafka.additivity = false logger.folio_kafka.appenderRef.stdout.ref = STDOUT -rootLogger.level = ${sys:LOG_LEVEL:-INFO} +rootLogger.level = info rootLogger.appenderRefs = info rootLogger.appenderRef.stdout.ref = STDOUT