From 3569ff0ea57fc230bdaab2d142242fc0ef242f7e Mon Sep 17 00:00:00 2001
From: SinghAdes <90304030+SinghAdes@users.noreply.github.com>
Date: Thu, 14 Mar 2024 18:44:50 +0530
Subject: [PATCH] MODRS-194 Upgrading dependencies for Quesnelia (#200)
* MODRS-194 Upgrading dependencies for Quesnelia
---
pom.xml | 27 ++---
.../folio/rs/config/KafkaConfiguration.java | 7 +-
.../swagger.api/schemas/instance.json | 100 +-----------------
.../schemas/instanceContributors.json | 32 ++++++
.../schemas/instanceIdentifiers.json | 20 ++++
.../schemas/instancePublication.json | 23 ++++
.../resources/swagger.api/schemas/item.json | 8 +-
.../schemas/itemContributorNames.json | 11 ++
8 files changed, 107 insertions(+), 121 deletions(-)
create mode 100644 src/main/resources/swagger.api/schemas/instanceContributors.json
create mode 100644 src/main/resources/swagger.api/schemas/instanceIdentifiers.json
create mode 100644 src/main/resources/swagger.api/schemas/instancePublication.json
create mode 100644 src/main/resources/swagger.api/schemas/itemContributorNames.json
diff --git a/pom.xml b/pom.xml
index 1e4419f1..fdc6756b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 3.1.5
+ 3.2.3
@@ -23,25 +23,18 @@
17
- 7.2.0
- 7.3.0-SNAPSHOT
- 6.6.0
+ 8.1.0
+ 7.3.0
1.5.5.Final
- 2.27.2
- 2.2.0
+ 3.4.2
+ 2.5.0
42.6.0
2.11.2
- 2.2
- 5.3.6
35.1.0
-
- 3.5.1
-
3.3.1
3.3.1
- 1.0
+ 1.0.1
1.2.1
3.0.1
src/main/java/org/folio/rs/domain/**, src/main/java/org/folio/rs/client/AuthnClient.java,
@@ -53,13 +46,13 @@
org.folio
folio-spring-base
- ${folio-spring-base.version}
+ ${folio-spring.version}
org.folio
folio-spring-system-user
- ${folio-spring-system-user.version}
+ ${folio-spring.version}
@@ -184,9 +177,9 @@
- com.github.tomakehurst
+ org.wiremock
wiremock-standalone
- ${wiremock.version}
+ ${wiremock-standalone.version}
test
diff --git a/src/main/java/org/folio/rs/config/KafkaConfiguration.java b/src/main/java/org/folio/rs/config/KafkaConfiguration.java
index faebd8cb..da46aeef 100644
--- a/src/main/java/org/folio/rs/config/KafkaConfiguration.java
+++ b/src/main/java/org/folio/rs/config/KafkaConfiguration.java
@@ -16,6 +16,7 @@
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
+import org.springframework.kafka.listener.DefaultErrorHandler;
import org.springframework.kafka.support.serializer.JsonDeserializer;
import lombok.RequiredArgsConstructor;
@@ -34,15 +35,17 @@ public ConcurrentKafkaListenerContainerFactory kafkaListene
var factory = new ConcurrentKafkaListenerContainerFactory();
factory.setBatchListener(true);
factory.setConsumerFactory(jsonNodeConsumerFactory());
- factory.setBatchErrorHandler(((exception, data) -> log.error("Error in process with Exception {} and the record is {}", exception, data)));
+ factory.setCommonErrorHandler(new DefaultErrorHandler((exception, data) -> log.error(
+ "Error in process with Exception {} and the record is {}", exception, data)));
return factory;
}
private ConsumerFactory jsonNodeConsumerFactory() {
var deserializer = new JsonDeserializer<>(DomainEvent.class);
- Map config = new HashMap<>(kafkaProperties.buildConsumerProperties());
+ Map config = new HashMap<>(kafkaProperties.buildConsumerProperties(null));
config.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
config.put(VALUE_DESERIALIZER_CLASS_CONFIG, deserializer);
return new DefaultKafkaConsumerFactory<>(config, new StringDeserializer(), deserializer);
}
+
}
diff --git a/src/main/resources/swagger.api/schemas/instance.json b/src/main/resources/swagger.api/schemas/instance.json
index 8359eefe..68f0f962 100644
--- a/src/main/resources/swagger.api/schemas/instance.json
+++ b/src/main/resources/swagger.api/schemas/instance.json
@@ -132,22 +132,7 @@
"description": "An extensible set of name-value pairs of identifiers associated with the resource",
"minItems": 0,
"items": {
- "type": "object",
- "properties": {
- "value": {
- "type": "string",
- "description": "Resource identifier value"
- },
- "identifierTypeId": {
- "type": "string",
- "description": "Resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)"
- }
- },
- "additionalProperties": false,
- "required": [
- "value",
- "identifierTypeId"
- ]
+ "$ref": "instanceIdentifiers.json"
}
},
"contributors": {
@@ -155,34 +140,7 @@
"description": "List of contributors",
"minItems": 0,
"items": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "Personal name, corporate name, meeting name"
- },
- "contributorTypeId": {
- "type": "string",
- "description": "ID for the contributor type term defined as a referencetable in settings"
- },
- "contributorTypeText": {
- "type": "string",
- "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators"
- },
- "contributorNameTypeId": {
- "type": "string",
- "description": "Contributor type terms defined by the MARC code list for relators"
- },
- "primary": {
- "type": "boolean",
- "description": "Whether this is the primary contributor"
- }
- },
- "additionalProperties": false,
- "required": [
- "name",
- "contributorNameTypeId"
- ]
+ "$ref": "instanceContributors.json"
}
},
"subjects": {
@@ -230,25 +188,7 @@
"type": "array",
"description": "List of publication items",
"items": {
- "type": "object",
- "properties": {
- "publisher": {
- "type": "string",
- "description": "Name of publisher, distributor, etc."
- },
- "place": {
- "type": "string",
- "description": "Place of publication, distribution, etc."
- },
- "dateOfPublication": {
- "type": "string",
- "description": "Date (year YYYY) of publication, distribution, etc."
- },
- "role": {
- "type": "string",
- "description": "The role of the publisher, distributor, etc."
- }
- }
+ "$ref": "instancePublication.json"
}
},
"publicationFrequency": {
@@ -456,22 +396,7 @@
"description": "An extensible set of name-value pairs of identifiers associated with the resource",
"minItems": 0,
"items": {
- "type": "object",
- "properties": {
- "value": {
- "type": "string",
- "description": "Resource identifier value"
- },
- "identifierTypeId": {
- "type": "string",
- "description": "Resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)"
- }
- },
- "additionalProperties": false,
- "required": [
- "value",
- "identifierTypeId"
- ]
+ "$ref": "instanceIdentifiers.json"
}
}
},
@@ -507,22 +432,7 @@
"description": "An extensible set of name-value pairs of identifiers associated with the resource",
"minItems": 0,
"items": {
- "type": "object",
- "properties": {
- "value": {
- "type": "string",
- "description": "Resource identifier value"
- },
- "identifierTypeId": {
- "type": "string",
- "description": "Resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)"
- }
- },
- "additionalProperties": false,
- "required": [
- "value",
- "identifierTypeId"
- ]
+ "$ref": "instanceIdentifiers.json"
}
}
},
diff --git a/src/main/resources/swagger.api/schemas/instanceContributors.json b/src/main/resources/swagger.api/schemas/instanceContributors.json
new file mode 100644
index 00000000..d970073c
--- /dev/null
+++ b/src/main/resources/swagger.api/schemas/instanceContributors.json
@@ -0,0 +1,32 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Contributors",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Personal name, corporate name, meeting name"
+ },
+ "contributorTypeId": {
+ "type": "string",
+ "description": "ID for the contributor type term defined as a referencetable in settings"
+ },
+ "contributorTypeText": {
+ "type": "string",
+ "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators"
+ },
+ "contributorNameTypeId": {
+ "type": "string",
+ "description": "Contributor type terms defined by the MARC code list for relators"
+ },
+ "primary": {
+ "type": "boolean",
+ "description": "Whether this is the primary contributor"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "name",
+ "contributorNameTypeId"
+ ]
+}
diff --git a/src/main/resources/swagger.api/schemas/instanceIdentifiers.json b/src/main/resources/swagger.api/schemas/instanceIdentifiers.json
new file mode 100644
index 00000000..8cd9a4fd
--- /dev/null
+++ b/src/main/resources/swagger.api/schemas/instanceIdentifiers.json
@@ -0,0 +1,20 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "An extensible name-value pairs associated with the resource",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "Resource identifier value"
+ },
+ "identifierTypeId": {
+ "type": "string",
+ "description": "Resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "value",
+ "identifierTypeId"
+ ]
+}
diff --git a/src/main/resources/swagger.api/schemas/instancePublication.json b/src/main/resources/swagger.api/schemas/instancePublication.json
new file mode 100644
index 00000000..51b16eb6
--- /dev/null
+++ b/src/main/resources/swagger.api/schemas/instancePublication.json
@@ -0,0 +1,23 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Publication items",
+ "type": "object",
+ "properties": {
+ "publisher": {
+ "type": "string",
+ "description": "Name of publisher, distributor, etc."
+ },
+ "place": {
+ "type": "string",
+ "description": "Place of publication, distribution, etc."
+ },
+ "dateOfPublication": {
+ "type": "string",
+ "description": "Date (year YYYY) of publication, distribution, etc."
+ },
+ "role": {
+ "type": "string",
+ "description": "The role of the publisher, distributor, etc."
+ }
+ }
+}
diff --git a/src/main/resources/swagger.api/schemas/item.json b/src/main/resources/swagger.api/schemas/item.json
index f46245f0..d2a7f2cf 100644
--- a/src/main/resources/swagger.api/schemas/item.json
+++ b/src/main/resources/swagger.api/schemas/item.json
@@ -44,13 +44,7 @@
"description": "A list of contributor names",
"type": "array",
"items": {
- "type": "object",
- "properties": {
- "name": {
- "description": "The contributor name",
- "type": "string"
- }
- }
+ "$ref": "itemContributorNames.json"
}
},
"callNumber": {
diff --git a/src/main/resources/swagger.api/schemas/itemContributorNames.json b/src/main/resources/swagger.api/schemas/itemContributorNames.json
new file mode 100644
index 00000000..95e05109
--- /dev/null
+++ b/src/main/resources/swagger.api/schemas/itemContributorNames.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Contributor names",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "The contributor name",
+ "type": "string"
+ }
+ }
+}