Skip to content

Commit

Permalink
MSEARCH-617 Ignore hard-delete domain authority events
Browse files Browse the repository at this point in the history
  • Loading branch information
GeloPakDev1 committed Nov 9, 2023
1 parent ac30f21 commit 7f3f788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Requires `API_NAME vX.Y`

### Features
* Description ([ISSUE_NUMBER](https://issues.folio.org/browse/ISSUE_NUMBER))
* Add filter to ignore hard-delete authority events ([MSEARCH-617](https://issues.folio.org/browse/MSEARCH-617))

### Bug fixes
* Fix secure setup of system users by default ([MSEARCH-608](https://issues.folio.org/browse/MSEARCH-608))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ public boolean filter(ConsumerRecord<String, ResourceEvent> consumerRecord) {
var resourceEvent = consumerRecord.value();
var resourceName = resourceEvent.getResourceName();
var resourceEventType = resourceEvent.getType();
if (resourceEventType == ResourceEventType.DELETE) {
log.info("Processing resource event [resourceName: {}]", resourceName);
if (resourceName != null && resourceName.equals(AUTHORITY_RESOURCE)
&& resourceEvent.getSubType() == ResourceEventSubType.HARD_DELETE) {
log.info("Skip event. No need to process event for authority resource");
if (ResourceEventType.DELETE == resourceEventType) {
if (AUTHORITY_RESOURCE.equals(resourceName)
&& ResourceEventSubType.HARD_DELETE == resourceEvent.getSubType()) {
log.info("Skip hard-delete event. No need to process event for authority resource");
return true;
}
}
Expand Down

0 comments on commit 7f3f788

Please sign in to comment.