diff --git a/NEWS.md b/NEWS.md
index c128527a5..b41623216 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,26 @@
-## v27.2.0 In progress
+## v28.0.0 In progress
+### Breaking changes
+* Migrate "publicationPeriod" data to the Dates object and remove it from the Instance schema ([MODINVSTOR-1232](https://folio-org.atlassian.net/browse/MODINVSTOR-1232))
+
+### New APIs versions
+* Provides `instance-storage 11.0`
+* Provides `instance-storage-batch 3.0`
+* Provides `instance-storage-batch-sync 3.0`
+* Provides `instance-storage-batch-sync-unsafe 3.0`
+* Provides `inventory-view 3.0`
+* Provides `inventory-view-instance-set 3.0`
+* Provides `instance-iteration 1.0`
+* Requires `holdings-storage 8.0`
+* Requires `bound-with-parts-storage 2.0`
+* Requires `async-migration 1.0`
+
+### Features
+* Add module descriptor validator plugin and fix the permission names ([MODINVSTOR-1247](https://folio-org.atlassian.net/browse/MODINVSTOR-1247))
+
+### Tech Dept
+* Upgrade localstack from 0.11.3 to s3-latest (=3.8.0) ([MODINVSTOR-1272](https://folio-org.atlassian.net/browse/MODINVSTOR-1272))
+## v27.2.0 2024-09-24
### Breaking changes
* Required sourceId field in holdings record ([MODINVSTOR-1161](https://folio-org.atlassian.net/browse/MODINVSTOR-1161))
@@ -29,7 +50,7 @@
* Add new date type fields to Instance schema ([MODINVSTOR-1188](https://folio-org.atlassian.net/browse/MODINVSTOR-1188))
* Implement endpoint for bulk instances upsert from external file ([MODINVSTOR-1225](https://folio-org.atlassian.net/browse/MODINVSTOR-1225))
* Add Subject source and Subject type to schema ([MODINVSTOR-1205](https://folio-org.atlassian.net/browse/MODINVSTOR-1205))
-
+* Add codes to Subject sources ([MODINVSTOR-1264](https://folio-org.atlassian.net/browse/MODINVSTOR-1264))
### Bug fixes
* Unintended update of instance records \_version (optimistic locking) whenever any of its holdings or items are created, updated or deleted. ([MODINVSTOR-1186](https://folio-org.atlassian.net/browse/MODINVSTOR-1186))
@@ -37,6 +58,8 @@
* Do not delete Kafka topics on postTenant if collection topics is enabled ([MODINVSTOR-1192](https://folio-org.atlassian.net/browse/MODINVSTOR-1192))
* Identifier types: change Cancelled LCCN to Canceled LCCN ([MODINVSTOR-1212](https://folio-org.atlassian.net/browse/MODINVSTOR-1212))
* Add user-tenants.collection.get to all ECS APIs ([MODINVSTOR-1253](https://folio-org.atlassian.net/browse/MODINVSTOR-1253))
+* Add user-tenants.collection.get to POST /\_/tenant API ([MODINVSTOR-1260](https://folio-org.atlassian.net/browse/MODINVSTOR-1260))
+* Update "BC" name in GET instance-date-type to "B.C." ([MODINVSTOR-1255](https://folio-org.atlassian.net/browse/MODINVSTOR-1255))
### Tech Dept
* Kafka testcontainers: kafka.KafkaContainer, apache/kafka-native:3.8.0, KafkaTopicsExistsTest fix ([MODINVSTOR-1251](https://folio-org.atlassian.net/browse/MODINVSTOR-1251))
@@ -47,6 +70,7 @@
* Bump `holdings-storage` from `6.0` to `7.0`
* Bump `holdings-storage-batch-sync` from `1.1` to `2.0`
* Bump `holdings-storage-batch-sync-unsafe` from `1.0` to `2.0`
+* Bump `folio-kafka-wrapper` from `3.1.1` to `3.2.0`
* Add `folio-s3-client` `2.2.0`
* Add `LIB_NAME` `2.7.4`
* Remove `LIB_NAME`
diff --git a/README.MD b/README.MD
index f46e9e7cd..2aeee5343 100644
--- a/README.MD
+++ b/README.MD
@@ -114,6 +114,20 @@ These properties can be changed by setting env variable.
* `KAFKA_REINDEX_RECORDS_TOPIC_NUM_PARTITIONS` Default value - `16`
* `KAFKA_SUBJECT_SOURCE_TOPIC_NUM_PARTITIONS` Default value - `1`
+There is also possibility for customizing through properties the Kafka Topic
+`message retention` (in milliseconds) and `maximum message size` (in bytes). The default values of these configurations
+for any topic are 604800000 milliseconds (or 1 week) and 1048576 bytes (or 1 MB) respectively
+
+These are the defined topic properties for `message retention` and `maximum message size` for `reindex-records` topic
+
+* `KAFKA_REINDEX_RECORDS_TOPIC_MESSAGE_RETENTION` Default value - `86400000` (1 day)
+* `KAFKA_REINDEX_RECORDS_TOPIC_MAX_MESSAGE_SIZE` Default value - `1048576` (1 MB)
+
+in case, any of these topic properties are changed for `reindex-records` the topic needs to be recreated and module needs to be reinstalled.
+
+Changing maximum message size for kafka producer:
+* `KAFKA_REINDEX_PRODUCER_MAX_REQUEST_SIZE_BYTES` Default value - `10485760` (10 MB)
+
# Building
run `mvn install` from the root directory.
@@ -142,6 +156,8 @@ These environment variables configure Kafka topic for specific business-related
* `KAFKA_SUBJECT_TYPE_TOPIC_NUM_PARTITIONS`
* `KAFKA_REINDEX_RECORDS_TOPIC_NUM_PARTITIONS`
* `KAFKA_SUBJECT_SOURCE_TOPIC_NUM_PARTITIONS`
+* `KAFKA_REINDEX_RECORDS_TOPIC_MESSAGE_RETENTION`
+* `KAFKA_REINDEX_RECORDS_TOPIC_MAX_MESSAGE_SIZE`
mod-inventory-storage also supports all Raml Module Builder (RMB) environment variables,
for details see [RMB](https://github.com/folio-org/raml-module-builder#environment-variables):
diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json
index 0a986b04e..24a141f28 100755
--- a/descriptors/ModuleDescriptor-template.json
+++ b/descriptors/ModuleDescriptor-template.json
@@ -95,7 +95,7 @@
},
{
"id": "holdings-storage",
- "version": "7.0",
+ "version": "8.0",
"handlers": [
{
"methods": ["GET"],
@@ -104,7 +104,7 @@
},{
"methods": ["POST"],
"pathPattern": "/holdings-storage/holdings/retrieve",
- "permissionsRequired": ["inventory-storage.holdings.collection.get"]
+ "permissionsRequired": ["inventory-storage.holdings.retrieve.collection.post"]
}, {
"methods": ["GET"],
"pathPattern": "/holdings-storage/holdings/{id}",
@@ -167,7 +167,7 @@
},
{
"id": "instance-storage",
- "version": "10.3",
+ "version": "11.0",
"handlers": [
{
"methods": ["GET"],
@@ -176,7 +176,7 @@
},{
"methods": ["POST"],
"pathPattern": "/instance-storage/instances/retrieve",
- "permissionsRequired": ["inventory-storage.instances.collection.get"]
+ "permissionsRequired": ["inventory-storage.instances.retrieve.collection.post"]
},
{
"methods": ["GET"],
@@ -274,7 +274,7 @@
},
{
"id": "instance-storage-batch",
- "version": "2.0",
+ "version": "3.0",
"handlers": [
{
"methods": ["POST"],
@@ -285,18 +285,18 @@
},
{
"id": "instance-storage-batch-sync",
- "version": "2.0",
+ "version": "3.0",
"handlers": [
{
"methods": ["POST"],
"pathPattern": "/instance-storage/batch/synchronous",
- "permissionsRequired": ["inventory-storage.instances.batch.post"]
+ "permissionsRequired": ["inventory-storage.instances.batch.synchronous.post"]
}
]
},
{
"id": "instance-storage-batch-sync-unsafe",
- "version": "2.0",
+ "version": "3.0",
"handlers": [
{
"methods": ["POST"],
@@ -1240,7 +1240,7 @@
},
{
"id": "bound-with-parts-storage",
- "version": "1.1",
+ "version": "2.0",
"handlers": [
{
"methods": ["GET"],
@@ -1266,9 +1266,7 @@
"methods": ["PUT"],
"pathPattern": "/inventory-storage/bound-withs",
"permissionsRequired": [
- "inventory-storage.bound-with-parts.collection.get",
- "inventory-storage.bound-with-parts.item.post",
- "inventory-storage.bound-with-parts.item.delete"
+ "inventory-storage.bound-withs.collection.put"
]
}
]
@@ -1280,7 +1278,10 @@
"handlers": [
{
"methods": ["POST"],
- "pathPattern": "/_/tenant"
+ "pathPattern": "/_/tenant",
+ "modulePermissions": [
+ "user-tenants.collection.get"
+ ]
}, {
"methods": ["DELETE", "GET"],
"pathPattern": "/_/tenant/{id}"
@@ -1336,7 +1337,7 @@
},
{
"id": "inventory-view",
- "version": "2.0",
+ "version": "3.0",
"handlers": [
{
"methods": ["GET"],
@@ -1347,7 +1348,7 @@
},
{
"id": "inventory-view-instance-set",
- "version": "2.0",
+ "version": "3.0",
"handlers": [
{
"methods": ["GET"],
@@ -1384,7 +1385,7 @@
},
{
"id": "instance-iteration",
- "version": "0.1",
+ "version": "1.0",
"handlers": [
{
"methods": ["POST"],
@@ -1405,7 +1406,7 @@
},
{
"id": "async-migration",
- "version": "0.1",
+ "version": "1.0",
"handlers": [
{
"methods": ["POST"],
@@ -1425,7 +1426,7 @@
{
"methods": ["GET"],
"pathPattern": "/inventory-storage/migrations/jobs",
- "permissionsRequired": ["inventory-storage.migration.job.item.get"]
+ "permissionsRequired": ["inventory-storage.migration.job.collection.get"]
},
{
"methods": ["DELETE"],
@@ -1522,6 +1523,11 @@
"displayName": "inventory storage - get holdings collection",
"description": "get holdings collection from storage"
},
+ {
+ "permissionName": "inventory-storage.holdings.retrieve.collection.post",
+ "displayName": "inventory storage - retrieve holdings collection",
+ "description": "retrieve holdings collection from storage"
+ },
{
"permissionName": "inventory-storage.holdings.collection.delete",
"displayName": "inventory storage - delete entire holdings collection",
@@ -1562,6 +1568,11 @@
"displayName": "inventory storage - get instance collection",
"description": "get instance collection from storage"
},
+ {
+ "permissionName": "inventory-storage.instances.retrieve.collection.post",
+ "displayName": "inventory storage - retrieve instance collection",
+ "description": "retrieve instance collection from storage"
+ },
{
"permissionName": "inventory-storage.instances.collection.delete",
"displayName": "inventory storage - delete entire instance collection",
@@ -1597,6 +1608,11 @@
"displayName": "inventory storage - create or update a number of instances",
"description": "create or update a number of instances in storage"
},
+ {
+ "permissionName": "inventory-storage.instances.batch.synchronous.post",
+ "displayName": "inventory storage - create or update a collection of instances in a single synchronous request",
+ "description": "create or update a collection of instances in a single synchronous request"
+ },
{
"permissionName": "inventory-storage.instances.batch-unsafe.post",
"displayName": "inventory storage - create or update a number of instances with optimistic locking disabled",
@@ -2538,6 +2554,11 @@
"displayName": "inventory storage - add a part to a bound-with",
"description": "add a holdings record to a bound-with by associating it with the bound-with item"
},
+ {
+ "permissionName": "inventory-storage.bound-withs.collection.put",
+ "displayName": "inventory storage - modify a bound-withs",
+ "description": "replace a holdings-records of a bound-withs or move it to a different bound-withs"
+ },
{
"permissionName": "inventory-storage.bound-with-parts.item.put",
"displayName": "inventory storage - modify a bound-with part",
@@ -2603,6 +2624,11 @@
"displayName": "inventory storage - get migration job by id",
"description": "get migration job by id"
},
+ {
+ "permissionName": "inventory-storage.migration.job.collection.get",
+ "displayName": "inventory storage - get migration jobs",
+ "description": "get migration jobs"
+ },
{
"permissionName": "inventory-storage.migration.item.get",
"displayName": "inventory storage - get list of available migrations",
@@ -2644,6 +2670,7 @@
"inventory-storage.items.batch.post",
"inventory-storage.items.batch-unsafe.post",
"inventory-storage.holdings.collection.get",
+ "inventory-storage.holdings.retrieve.collection.post",
"inventory-storage.holdings.item.get",
"inventory-storage.holdings.item.post",
"inventory-storage.holdings.item.put",
@@ -2652,6 +2679,7 @@
"inventory-storage.holdings.batch.post",
"inventory-storage.holdings.batch-unsafe.post",
"inventory-storage.instances.collection.get",
+ "inventory-storage.instances.retrieve.collection.post",
"inventory-storage.instances.item.get",
"inventory-storage.instances.item.post",
"inventory-storage.instances.item.put",
@@ -2663,6 +2691,7 @@
"inventory-storage.instances.source-record.marc-json.delete",
"inventory-storage.instances.collection.delete",
"inventory-storage.instances.batch.post",
+ "inventory-storage.instances.batch.synchronous.post",
"inventory-storage.instances.batch-unsafe.post",
"inventory-storage.instances.bulk.post",
"inventory-storage.loan-types.collection.get",
@@ -2850,6 +2879,7 @@
"inventory-storage.bound-with-parts.collection.get",
"inventory-storage.bound-with-parts.item.get",
"inventory-storage.bound-with-parts.item.post",
+ "inventory-storage.bound-withs.collection.put",
"inventory-storage.bound-with-parts.item.put",
"inventory-storage.bound-with-parts.item.delete",
"inventory-storage.inventory-hierarchy.updated-instances-ids.collection.get",
@@ -2867,6 +2897,7 @@
"inventory-storage.migration.job.item.delete",
"inventory-storage.migration.job.post",
"inventory-storage.migration.job.item.get",
+ "inventory-storage.migration.job.collection.get",
"inventory-storage.migration.item.get",
"inventory-storage.reindex-records.publish.post",
"inventory-storage.instance-date-types.collection.get",
@@ -2914,6 +2945,9 @@
{ "name": "KAFKA_SUBJECT_TYPE_TOPIC_NUM_PARTITIONS", "value": "1"},
{ "name": "KAFKA_SUBJECT_SOURCE_TOPIC_NUM_PARTITIONS", "value": "1"},
{ "name": "KAFKA_REINDEX_RECORDS_TOPIC_NUM_PARTITIONS", "value": "16"},
+ { "name": "KAFKA_REINDEX_RECORDS_TOPIC_MESSAGE_RETENTION", "value": "86400000"},
+ { "name": "KAFKA_REINDEX_RECORDS_TOPIC_MAX_MESSAGE_SIZE", "value": "1048576"},
+ { "name": "KAFKA_REINDEX_PRODUCER_MAX_REQUEST_SIZE_BYTES", "value": "10485760"},
{ "name": "S3_URL", "value": "http://127.0.0.1:9000/" },
{ "name": "S3_REGION", "value": "" },
{ "name": "S3_BUCKET", "value": "marc-migrations" },
diff --git a/pom.xml b/pom.xml
index 760dd49d9..fd73aa35d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
mod-inventory-storage
org.folio
- 27.2.0-SNAPSHOT
+ 28.0.0-SNAPSHOT
UTF-8
@@ -12,22 +12,22 @@
/instance-storage/instances,/instance-storage/instances/retrieve,/holdings-storage/holdings,/holdings-storage/holdings/retrieve,/item-storage/items,/record-bulk/ids,/oai-pmh-view/instances,/oai-pmh-view/updatedInstanceIds,/oai-pmh-view/enrichedInstances,/inventory-hierarchy/updated-instance-ids,/inventory-hierarchy/items-and-holdings,/inventory-view/instances
- 35.2.2
+ 35.3.0
4.5.10
- 2.9.5
+ 2.9.6
1.9.22.1
- 3.1.1
+ 3.2.0-SNAPSHOT
3.1.8
1.18.34
- 1.1.10.6
+ 1.1.10.7
3.17.0
- 2.24.0
+ 2.24.1
2.2.0-SNAPSHOT
- 6.0.2
- 5.11.0
- 1.20.1
- 2.12.7
+ 6.0.3
+ 5.11.2
+ 1.20.2
+ 2.13.0
3.0
4.13.2
5.2.0
@@ -47,11 +47,12 @@
3.3.1
1.0.1
3.6.0
- 3.5.0
+ 3.5.1
3.5.0
- 10.18.1
- 3.5.0
+ 10.18.2
+ 3.5.1
2.17.1
+ 1.0.0
@@ -238,7 +239,6 @@
org.testcontainers
localstack
- ${localstack.version}
test
@@ -645,6 +645,19 @@
+
+ org.folio
+ folio-module-descriptor-validator
+ ${folio-module-descriptor-validator.version}
+ false
+
+
+
+ validate
+
+
+
+
diff --git a/ramls/instance-iteration.raml b/ramls/instance-iteration.raml
index 08912246b..955d07576 100644
--- a/ramls/instance-iteration.raml
+++ b/ramls/instance-iteration.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Iterate instances
-version: v0.1
+version: v1.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost
diff --git a/ramls/instance-set.raml b/ramls/instance-set.raml
index 6dfa2f7d1..6d2adece2 100644
--- a/ramls/instance-set.raml
+++ b/ramls/instance-set.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Instance Set API
-version: v2.0
+version: v3.0
protocols: [ HTTP, HTTPS ]
baseUri: http://github.com/org/folio/mod-inventory-storage
diff --git a/ramls/instance-storage-batch.raml b/ramls/instance-storage-batch.raml
index 5224ddc97..b28f3fc2a 100644
--- a/ramls/instance-storage-batch.raml
+++ b/ramls/instance-storage-batch.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Deprecated Inventory Storage Instance Batch API
-version: v2.0
+version: v3.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost
diff --git a/ramls/instance-storage.raml b/ramls/instance-storage.raml
index 968a24439..373a5785b 100644
--- a/ramls/instance-storage.raml
+++ b/ramls/instance-storage.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Instance Storage
-version: v10.0
+version: v11.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost
diff --git a/ramls/instance-sync-unsafe.raml b/ramls/instance-sync-unsafe.raml
index ec9b8fbdd..851719f1c 100644
--- a/ramls/instance-sync-unsafe.raml
+++ b/ramls/instance-sync-unsafe.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Inventory Storage Instance Batch Sync Unsafe API
-version: v2.0
+version: v3.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost
diff --git a/ramls/instance-sync.raml b/ramls/instance-sync.raml
index e6d98290e..f0a83a416 100644
--- a/ramls/instance-sync.raml
+++ b/ramls/instance-sync.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Inventory Storage Instance Batch Sync API
-version: v2.0
+version: v3.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost
diff --git a/ramls/inventory-view.raml b/ramls/inventory-view.raml
index b0c6a7a84..1d25d5268 100644
--- a/ramls/inventory-view.raml
+++ b/ramls/inventory-view.raml
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Inventory Storage View API
-version: v2.0
+version: v3.0
protocols: [ HTTP, HTTPS ]
baseUri: http://github.com/org/folio/mod-inventory-storage
diff --git a/ramls/raml-util b/ramls/raml-util
index c113f109d..0b1259759 160000
--- a/ramls/raml-util
+++ b/ramls/raml-util
@@ -1 +1 @@
-Subproject commit c113f109d1379d15230f3f8a3485e61ffccc0ad8
+Subproject commit 0b125975982df99324c88c200d50abe2b22f7688
diff --git a/ramls/subject-source.json b/ramls/subject-source.json
index dd6ad63c3..9b81b4efc 100644
--- a/ramls/subject-source.json
+++ b/ramls/subject-source.json
@@ -7,15 +7,20 @@
"type": "string"
},
"name": {
- "description": "label for the subject source",
+ "description": "label for the subject source name",
+ "type": "string"
+ },
+ "code": {
+ "description": "label for the subject source code",
"type": "string"
},
"source": {
"type": "string",
- "description": "label indicating where the subject source entry originates from, i.e. 'folio' or 'local'",
+ "description": "label indicating where the subject source entry originates from, i.e. 'folio', 'local' or 'consortium'",
"enum": [
"folio",
- "local"
+ "local",
+ "consortium"
]
},
"metadata": {
@@ -25,6 +30,7 @@
}
},
"required": [
- "name"
+ "name",
+ "source"
]
}
diff --git a/ramls/subject-type.json b/ramls/subject-type.json
index b9808b1d6..975efbde1 100644
--- a/ramls/subject-type.json
+++ b/ramls/subject-type.json
@@ -12,10 +12,11 @@
},
"source": {
"type": "string",
- "description": "label indicating where the subject type entry originates from, i.e. 'folio' or 'local'",
+ "description": "label indicating where the subject type entry originates from, i.e. 'folio', 'local' or 'consortium'",
"enum": [
"folio",
- "local"
+ "local",
+ "consortium"
]
},
"metadata": {
@@ -25,6 +26,7 @@
}
},
"required": [
- "name"
+ "name",
+ "source"
]
}
diff --git a/reference-data/instance-date-types/no-dates.json b/reference-data/instance-date-types/no-dates.json
index 4d4616695..3393ee3e6 100644
--- a/reference-data/instance-date-types/no-dates.json
+++ b/reference-data/instance-date-types/no-dates.json
@@ -1,6 +1,6 @@
{
"id": "77a09c3c-37bd-4ad3-aae4-9d86fc1b33d8",
- "name": "No dates given; BC date involved",
+ "name": "No dates given; B.C. date involved",
"code": "b",
"displayFormat": {
"delimiter": ",",
diff --git a/reference-data/subject-sources/CanadianSubjectHeadings.json b/reference-data/subject-sources/CanadianSubjectHeadings.json
new file mode 100644
index 000000000..ecb51ac69
--- /dev/null
+++ b/reference-data/subject-sources/CanadianSubjectHeadings.json
@@ -0,0 +1,6 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d45",
+ "name": "Canadian Subject Headings",
+ "code" : "cash",
+ "source": "folio"
+}
diff --git a/reference-data/subject-sources/LibraryofCongressChildrensandYoungAdultsSubjectHeadings.json b/reference-data/subject-sources/LibraryofCongressChildrensandYoungAdultsSubjectHeadings.json
new file mode 100644
index 000000000..e98fb7cb1
--- /dev/null
+++ b/reference-data/subject-sources/LibraryofCongressChildrensandYoungAdultsSubjectHeadings.json
@@ -0,0 +1,6 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d41",
+ "name": "Library of Congress Children's and Young Adults' Subject Headings",
+ "code" : "cyac",
+ "source": "folio"
+}
diff --git a/reference-data/subject-sources/LibraryofCongressSubjectHeadings.json b/reference-data/subject-sources/LibraryofCongressSubjectHeadings.json
new file mode 100644
index 000000000..e1ce7a480
--- /dev/null
+++ b/reference-data/subject-sources/LibraryofCongressSubjectHeadings.json
@@ -0,0 +1,6 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d40",
+ "name": "Library of Congress Subject Headings",
+ "code" : "lcsh",
+ "source": "folio"
+}
diff --git a/reference-data/subject-sources/MedicalSubjectHeadings.json b/reference-data/subject-sources/MedicalSubjectHeadings.json
new file mode 100644
index 000000000..7acd5d1d0
--- /dev/null
+++ b/reference-data/subject-sources/MedicalSubjectHeadings.json
@@ -0,0 +1,6 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d42",
+ "name": "Medical Subject Headings",
+ "code" : "mesh",
+ "source": "folio"
+}
diff --git a/reference-data/subject-sources/NationalAgriculturalLibrarysubjectauthorityfile.json b/reference-data/subject-sources/NationalAgriculturalLibrarysubjectauthorityfile.json
new file mode 100644
index 000000000..c45c88fc4
--- /dev/null
+++ b/reference-data/subject-sources/NationalAgriculturalLibrarysubjectauthorityfile.json
@@ -0,0 +1,5 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d43",
+ "name": "National Agricultural Library subject authority file",
+ "source": "folio"
+}
diff --git a/reference-data/subject-sources/Repertoiredevedettes-matiere.json b/reference-data/subject-sources/Repertoiredevedettes-matiere.json
new file mode 100644
index 000000000..92a96d2f8
--- /dev/null
+++ b/reference-data/subject-sources/Repertoiredevedettes-matiere.json
@@ -0,0 +1,6 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d46",
+ "name": "Répertoire de vedettes-matière",
+ "code" : "rvm",
+ "source": "folio"
+}
diff --git a/reference-data/subject-sources/Sourcenotspecified.json b/reference-data/subject-sources/Sourcenotspecified.json
new file mode 100644
index 000000000..3cb528337
--- /dev/null
+++ b/reference-data/subject-sources/Sourcenotspecified.json
@@ -0,0 +1,5 @@
+{
+ "id": "e894d0dc-621d-4b1d-98f6-6f7120eb0d44",
+ "name": "Source not specified",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Chronologicalterm.json b/reference-data/subject-types/Chronologicalterm.json
new file mode 100644
index 000000000..a8caea560
--- /dev/null
+++ b/reference-data/subject-types/Chronologicalterm.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b6",
+ "name": "Chronological term",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Corporatename.json b/reference-data/subject-types/Corporatename.json
new file mode 100644
index 000000000..734ede198
--- /dev/null
+++ b/reference-data/subject-types/Corporatename.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b2",
+ "name": "Corporate name",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Curriculumobjective.json b/reference-data/subject-types/Curriculumobjective.json
new file mode 100644
index 000000000..2d0bcefa8
--- /dev/null
+++ b/reference-data/subject-types/Curriculumobjective.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff514",
+ "name": "Curriculum objective",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Facetedtopicalterms.json b/reference-data/subject-types/Facetedtopicalterms.json
new file mode 100644
index 000000000..f1176238a
--- /dev/null
+++ b/reference-data/subject-types/Facetedtopicalterms.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff510",
+ "name": "Faceted topical terms",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Function.json b/reference-data/subject-types/Function.json
new file mode 100644
index 000000000..c43c2e9e0
--- /dev/null
+++ b/reference-data/subject-types/Function.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff513",
+ "name": "Function",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Genreform.json b/reference-data/subject-types/Genreform.json
new file mode 100644
index 000000000..1d0cfcce0
--- /dev/null
+++ b/reference-data/subject-types/Genreform.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff511",
+ "name": "Genre/form",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Geographicname.json b/reference-data/subject-types/Geographicname.json
new file mode 100644
index 000000000..0a3067049
--- /dev/null
+++ b/reference-data/subject-types/Geographicname.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b8",
+ "name": "Geographic name",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Hierarchicalplacename.json b/reference-data/subject-types/Hierarchicalplacename.json
new file mode 100644
index 000000000..46a4b5e6b
--- /dev/null
+++ b/reference-data/subject-types/Hierarchicalplacename.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff515",
+ "name": "Hierarchical place name",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Meetingname.json b/reference-data/subject-types/Meetingname.json
new file mode 100644
index 000000000..2849a1b25
--- /dev/null
+++ b/reference-data/subject-types/Meetingname.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b3",
+ "name": "Meeting name",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Namedevent.json b/reference-data/subject-types/Namedevent.json
new file mode 100644
index 000000000..fbba7917b
--- /dev/null
+++ b/reference-data/subject-types/Namedevent.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b5",
+ "name": "Named event",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Occupation.json b/reference-data/subject-types/Occupation.json
new file mode 100644
index 000000000..b55be58b1
--- /dev/null
+++ b/reference-data/subject-types/Occupation.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff512",
+ "name": "Occupation",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Personalname.json b/reference-data/subject-types/Personalname.json
new file mode 100644
index 000000000..78d941222
--- /dev/null
+++ b/reference-data/subject-types/Personalname.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b1",
+ "name": "Personal name",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Topicalterm.json b/reference-data/subject-types/Topicalterm.json
new file mode 100644
index 000000000..dbeedd146
--- /dev/null
+++ b/reference-data/subject-types/Topicalterm.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b7",
+ "name": "Topical term",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Typeofentityunspecified.json b/reference-data/subject-types/Typeofentityunspecified.json
new file mode 100644
index 000000000..6a2634b12
--- /dev/null
+++ b/reference-data/subject-types/Typeofentityunspecified.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff516",
+ "name": "Type of entity unspecified",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Uncontrolled.json b/reference-data/subject-types/Uncontrolled.json
new file mode 100644
index 000000000..1644db7cb
--- /dev/null
+++ b/reference-data/subject-types/Uncontrolled.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b9",
+ "name": "Uncontrolled",
+ "source": "folio"
+}
diff --git a/reference-data/subject-types/Uniformtitle.json b/reference-data/subject-types/Uniformtitle.json
new file mode 100644
index 000000000..d2ebdfd87
--- /dev/null
+++ b/reference-data/subject-types/Uniformtitle.json
@@ -0,0 +1,5 @@
+{
+ "id": "d6488f88-1e74-40ce-81b5-b19a928ff5b4",
+ "name": "Uniform title",
+ "source": "folio"
+}
diff --git a/src/main/java/org/folio/InventoryKafkaTopic.java b/src/main/java/org/folio/InventoryKafkaTopic.java
index f0125a5f1..b5e3e7281 100644
--- a/src/main/java/org/folio/InventoryKafkaTopic.java
+++ b/src/main/java/org/folio/InventoryKafkaTopic.java
@@ -44,6 +44,14 @@ public enum InventoryKafkaTopic implements KafkaTopic {
INSTANCE_DATE_TYPE, Pair.of("KAFKA_SUBJECT_SOURCE_TOPIC_NUM_PARTITIONS", "1")
);
+ private static final Map> TOPIC_MESSAGE_RETENTION_MAP = Map.of(
+ REINDEX_RECORDS, Pair.of("KAFKA_REINDEX_RECORDS_TOPIC_MESSAGE_RETENTION", "86400000") // 1 day
+ );
+
+ private static final Map> TOPIC_MESSAGE_MAX_SIZE_MAP = Map.of(
+ REINDEX_RECORDS, Pair.of("KAFKA_REINDEX_RECORDS_TOPIC_MAX_MESSAGE_SIZE", "1048576") // 1 MB
+ );
+
private final String topic;
InventoryKafkaTopic(String topic) {
@@ -63,8 +71,22 @@ public String topicName() {
@Override
public int numPartitions() {
return Optional.ofNullable(TOPIC_PARTITION_MAP.get(this))
- .map(pair -> getNumberOfPartitions(pair.getKey(), pair.getValue()))
- .orElse(getNumberOfPartitions(DEFAULT_NUM_PARTITIONS_PROPERTY, DEFAULT_NUM_PARTITIONS_VALUE));
+ .map(pair -> getPropertyValue(pair.getKey(), pair.getValue()))
+ .orElse(getPropertyValue(DEFAULT_NUM_PARTITIONS_PROPERTY, DEFAULT_NUM_PARTITIONS_VALUE));
+ }
+
+ @Override
+ public Integer messageRetentionTime() {
+ return Optional.ofNullable(TOPIC_MESSAGE_RETENTION_MAP.get(this))
+ .map(pair -> getPropertyValue(pair.getKey(), pair.getValue()))
+ .orElse(null);
+ }
+
+ @Override
+ public Integer messageMaxSize() {
+ return Optional.ofNullable(TOPIC_MESSAGE_MAX_SIZE_MAP.get(this))
+ .map(pair -> getPropertyValue(pair.getKey(), pair.getValue()))
+ .orElse(null);
}
public static InventoryKafkaTopic byTopic(String topic) {
@@ -76,7 +98,7 @@ public static InventoryKafkaTopic byTopic(String topic) {
throw new IllegalArgumentException("Unknown topic " + topic);
}
- private int getNumberOfPartitions(String propertyName, String defaultNumPartitions) {
+ private int getPropertyValue(String propertyName, String defaultNumPartitions) {
return Integer.parseInt(StringUtils.firstNonBlank(
System.getenv(propertyName),
System.getProperty(propertyName),
diff --git a/src/main/java/org/folio/persist/HoldingsRepository.java b/src/main/java/org/folio/persist/HoldingsRepository.java
index 2845cf1d1..7d8e086d6 100644
--- a/src/main/java/org/folio/persist/HoldingsRepository.java
+++ b/src/main/java/org/folio/persist/HoldingsRepository.java
@@ -7,6 +7,8 @@
import io.vertx.core.Future;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.RowSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import org.folio.cql2pgjson.CQL2PgJSON;
import org.folio.rest.jaxrs.model.HoldingsRecord;
@@ -32,4 +34,17 @@ public Future> delete(String cql) {
return Future.failedFuture(e);
}
}
+
+ public Future>> getReindexHoldingsRecords(String fromId, String toId) {
+ var sql = "SELECT jsonb FROM " + postgresClientFuturized.getFullTableName(HOLDINGS_RECORD_TABLE)
+ + " i WHERE id >= '" + fromId + "' AND id <= '" + toId + "'"
+ + ";";
+ return postgresClient.select(sql).map(rows -> {
+ var resultList = new LinkedList