...
Mapping of events to correct subscriptions
Prerequisite:
consumed event
For each xPath collect subscription IDs by querying database , i.e.
Code Block |
---|
final Collection<DataNode> existingNodes =
cpsQueryService.queryDataNodes(NCMP_DATASPACE_NAME, CM_SUBSCRIPTIONS_ANCHOR_NAME,
isOngoingCmSubscriptionCpsPathQuery, OMIT_DESCENDANTS);
if (existingNodes.isEmpty()) {
return Collections.emptyList();
}
return (List<String>) existingNodes.iterator().next().getLeaves().get("subscriptionIds") |
Identifying topic for given subscriptions
Process each subscription IDs and get a set of topics
Prerequisite:
format of subscription ID
format of topic name
Forwarding Notification based on subscription
Validating topic? (can this be done in creation of subscription?)
Prerequisite:
consumed event
topic name
Retry logic
Error Handling
...
unit tests
integration tests
E2E
k6?
Scenario | Expected Result |
---|---|
Consume event from DMI | No error , Log info level ? |
Publish event | Published event with correct details (topic name, event key, event) |
No subscription Ids returned for certain xpath (Notification maps to no subscription) | No forwarded event |
Notification maps to one subscription | Event forwarded to one topic |
Notification maps to multiple subscription (no duplication) | Event forwarded to more than one topic |
Notification maps to two subscriptions having the same topic | Event forwarded to one topic |
No topic extracted from subscription ID | log error? |
No write access to topic | log error |
Kafka not available? |
Monitoring and Logging
Metrics
...
log of errors? log key events? messaged produced, log consumed events?
Failed request when a client topic does not exist
...