Skip to content

Commit

Permalink
MODRS-194 Upgrading dependencies for Quesnelia (#200)
Browse files Browse the repository at this point in the history
* MODRS-194 Upgrading dependencies for Quesnelia
  • Loading branch information
SinghAdes authored Mar 14, 2024
1 parent 9be84e0 commit 3569ff0
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 121 deletions.
27 changes: 10 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.5</version>
<version>3.2.3</version>
<relativePath />
</parent>

Expand All @@ -23,25 +23,18 @@

<properties>
<java.version>17</java.version>
<folio-spring-base.version>7.2.0</folio-spring-base.version>
<folio-spring-system-user.version>7.3.0-SNAPSHOT</folio-spring-system-user.version>
<openapi-generator.version>6.6.0</openapi-generator.version>
<folio-spring.version>8.1.0</folio-spring.version>
<openapi-generator.version>7.3.0</openapi-generator.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<wiremock.version>2.27.2</wiremock.version>
<embedded.db.version>2.2.0</embedded.db.version>
<wiremock-standalone.version>3.4.2</wiremock-standalone.version>
<embedded.db.version>2.5.0</embedded.db.version>
<postgresql.version>42.6.0</postgresql.version>
<pubsub.client.version>2.11.2</pubsub.client.version>
<snakeyaml.version>2.2</snakeyaml.version>
<hazelcast.version>5.3.6</hazelcast.version>
<folio-util.version>35.1.0</folio-util.version>

<!-- bump kafka.version to fix snappy-java vulnerabilities;
remove <kafka.version> when using spring-boot-starter-parent >= 3.2 -->
<kafka.version>3.5.1</kafka.version>

<maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<copy-rename-maven-plugin.version>1.0</copy-rename-maven-plugin.version>
<copy-rename-maven-plugin.version>1.0.1</copy-rename-maven-plugin.version>
<jsonschema2pojo-maven-plugin.version>1.2.1</jsonschema2pojo-maven-plugin.version>
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
<sonar.exclusions>src/main/java/org/folio/rs/domain/**, src/main/java/org/folio/rs/client/AuthnClient.java,
Expand All @@ -53,13 +46,13 @@
<dependency>
<groupId>org.folio</groupId>
<artifactId>folio-spring-base</artifactId>
<version>${folio-spring-base.version}</version>
<version>${folio-spring.version}</version>
</dependency>

<dependency>
<groupId>org.folio</groupId>
<artifactId>folio-spring-system-user</artifactId>
<version>${folio-spring-system-user.version}</version>
<version>${folio-spring.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -184,9 +177,9 @@
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>${wiremock.version}</version>
<version>${wiremock-standalone.version}</version>
<scope>test</scope>
</dependency>

Expand Down
7 changes: 5 additions & 2 deletions src/main/java/org/folio/rs/config/KafkaConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,15 +35,17 @@ public ConcurrentKafkaListenerContainerFactory<String, DomainEvent> kafkaListene
var factory = new ConcurrentKafkaListenerContainerFactory<String, DomainEvent>();
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<String, DomainEvent> jsonNodeConsumerFactory() {
var deserializer = new JsonDeserializer<>(DomainEvent.class);
Map<String, Object> config = new HashMap<>(kafkaProperties.buildConsumerProperties());
Map<String, Object> 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);
}

}
100 changes: 5 additions & 95 deletions src/main/resources/swagger.api/schemas/instance.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,57 +132,15 @@
"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": {
"type": "array",
"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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -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"
}
}
},
Expand Down
32 changes: 32 additions & 0 deletions src/main/resources/swagger.api/schemas/instanceContributors.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
20 changes: 20 additions & 0 deletions src/main/resources/swagger.api/schemas/instanceIdentifiers.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
23 changes: 23 additions & 0 deletions src/main/resources/swagger.api/schemas/instancePublication.json
Original file line number Diff line number Diff line change
@@ -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."
}
}
}
8 changes: 1 addition & 7 deletions src/main/resources/swagger.api/schemas/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/swagger.api/schemas/itemContributorNames.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit 3569ff0

Please sign in to comment.