...
Assumptions
# | Assumption | Notes | |||
---|---|---|---|---|---|
1 | Forwarded Subscription Event communicates asynchronously. (NCMP to DMI Plugins) Thus, it is not required to wait for a single request to be responded. For example, NCMP has not to wait a response when Forwarded Subscription Event has been published into a topic, e.g. RequestXXX | .Once off timer would be responsible to publish messages in NCMP. | |||
2 | Forwarded Subscription Event Responses communicates asynchronously. (DMI Plugins to NCMP) | It is the same as above note. The Forwarded Subscription Event Responses published into a different topic, e.g. ResponseXXX. | 3 | The NCMP component need to keep the Request ID that is belong to each Kafka message and the timestamp when the message is published into RequestXXX topic. | 4 Then, the NCMP would wait a response(s) within the timeframe agreed on. TBD: A single step response or two step responses will be provided in the solution. |
3 | The NCMP component should consume messages periodically from ResponseXXX topic, and create Subscription Create Outcome message . | 5 | The NCMP component should publish Subscription Create Outcome message into another topic and publish it into topic (cm-avc-subscription-response) in which Client Apps consumed from. | The Outcome Response schema need to be decided on. |
Issues & Decisions
# | Issue | Notes | Decision | |
---|---|---|---|---|
21 | Possible 'timeframe' period | to consume Forwarded Subscription Create Event ResponsesTBD for timeframefor timeout | DMI to NCMP response timeout | 30 sec (Configurable param/property) |
2 | Response in two steps or in a single step should be discussed with shareholders. | from DMI to NCMP responses | Is the ACK would be required? |
Possible Topic Names
# | Source | Content | Topic Name | Destination |
---|---|---|---|---|
1 | NCMP | Forwarded Subscription Event | ncmp-dmi-cm-avc-subscription | DMI Plugins |
2 | DMI Plugins | Forwarded Subscription Event Response | dmi-ncmp-cm-avc-subscription | NCMP |
3 | NCMP | Subscription Event Outcome | cm-avc-subscription-response | Client Apps |
Implementation Details
- The NCMP component could utilize a Hash Map to store request_id and timestamp the time that message is published into the topic mentioned in #1 → Possible Topic Names
- In order to calculate the Subscription Create Outcome Message, the NCMP component should consume response messages from the topic mentioned in #2 → Possible Topic Names
The NCMP component should consume messages as per the timeframe periods, and compare request ids with the ones that already kept in that Hash Map at step 1. - If the incoming request id is found in the Hash Map, the total time elapsed could be calculated via timestamp (responses read) minus timestamp from Hash Map (for related request id).
- The NCMP can populate Subscription Event Outcome report, and publish it to the topic mentioned in #3 → Possible Topic Names would publish messages (Forwarded Subscription Event) to the topic ncmp-dmi-cm-avc-subscription via once-off timer.
- Then, the NCMP would wait a response(s) within the timeframe (timeout) agreed on e.g. 30 seconds.
- Response in two steps
- Ack (response with DMI plugin detais e.g. DMI X and Y has started to processing)
- Process result response: 2 out of 3 DMI has responed. (The percentage is %66.)
- Response in a single step
- Process result response: 2 out of 3 DMI has responed. (The percentage is %66.)
- Response in two steps
- Finally, the NCMP plugin create outcome message, and publish it to the topic cm-avc-subscription-response.