feat(publishing-events): change Kafka event publishing keys for holdings and items. #1108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
MODINVSTOR-1281 Currently, mod-search has an issue with processing events received from the mod-inventory-storage after creating a list of holdings for one Instance via the POST /holdings-storage/batch/synchronous endpoint.
The mod-inventory-storage publishes the list of events on creating holdings for an instance with the instanceId publishing key. So the list of events with the same instanceId publishing key are published.
The mod-search consumes events, groups them by key and processes only the one event, so in this case the rest events with the same instanceId key will not be processed and the data will not get into the holding table of the mod-search module.
The same issue with Items : POST /item-storage/batch/synchronous endpoint.
In order to avoid this issue, need to change the key for publishing events for holdings and items.
Approach
Kafka event publishing keys have been changed:
instanceId
toholdingId
;instanceId
toitemId
.Changes Checklist