Interface NotificationDuplicationFilter
- All Known Implementing Classes:
NotificationDuplicationFilter.TableNameDuplicationFilter
public interface NotificationDuplicationFilter
Interface for extracting a unique key from the JSON representation
of a
The key extracted from
If an empty
If two or more
Notification.getParameter() JSON to determine if the notification should be duplicate.The key extracted from
extractDuplicationKey(JsonNode)
will be used inside MultiTableChangeListener for duplication checks across all Notification's returned in a single poll.If an empty
Optional is returned then the given notification won't be deduplicated.If two or more
Notification's in a given poll batch share the same duplication key, then only one of them will be published to the listeners registered with the MultiTableChangeListener-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDefault filter to extract the "table_name" property from a JSON parameter. -
Method Summary
Modifier and TypeMethodDescriptionextractDuplicationKey(com.fasterxml.jackson.databind.JsonNode notificationParameterJson) Extracts the duplication key from the given parameter JSON.
-
Method Details
-
extractDuplicationKey
Optional<String> extractDuplicationKey(com.fasterxml.jackson.databind.JsonNode notificationParameterJson) Extracts the duplication key from the given parameter JSON.- Parameters:
notificationParameterJson- a JsonNode representing the JSON structure of theNotification.getParameter()JSON content- Returns:
- an
Optionalcontaining the unique key if extraction was successful, otherwise an emptyOptionalif this filter doesn't support the given parameter JSON or no filtering is required This key will be used insideMultiTableChangeListenerfor duplication checks across allNotification's returned in one poll
-