-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #1869 Design for reliable notifications on finalization of a transfer #288
base: master
Are you sure you want to change the base?
feat: #1869 Design for reliable notifications on finalization of a transfer #288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @mdebarros (and team).
A couple thoughts in addition to my inline comments:
- I would like to see examples and schemas of the
NotifyCMD
for other transports - Related to the above, requiring the notification command handler is a noble goal, and to do this properly, we need to make sure we have a good understanding of the requirements so we can design the messages from the Notification Evt Handler with the appropriate level of detail.
mojaloop-technical-overview/notifications/assets/sequence/seq-notify-v2-1.0.0.plantuml
Outdated
Show resolved
Hide resolved
…notify-v2-1.0.0.plantuml Co-authored-by: Lewis Daly <[email protected]>
Co-authored-by: Lewis Daly <[email protected]>
Thanks @lewisdaly for the feedback! See my inline comments below:
|
…sonfinalizationofatransfer
…re/#1869Designforreliablenotificationsonfinalizationofatransfer
1. Added schemas for both types of Domain and Command events 2. Updated SD to show validation of transport-types and content-types 3. Fixed typos
…sonfinalizationofatransfer
…forreliablenotificationsonfinalizationofatransfer
…onofatransfer' of github.com:mojaloop/documentation into feature/#1869Designforreliablenotificationsonfinalizationofatransfer
…gic, and recovery from failures
…gic, and recovery from failures
…gic, and recovery from failures
…gic, and recovery from failures
…gic, and recovery from failures
…gic, and recovery from failures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few other thoughts and questions for your consideration @mdebarros
mojaloop-technical-overview/notifications/assets/sequence/seq-notify-v2-1.0.0.plantuml
Show resolved
Hide resolved
|
||
| State | Description | Notes | | ||
| --- | --- | --- | | ||
| received | Indicates that the NotifyCmd event has been received by the Notification Cmd Handler. | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better word than received
here? At first glance through the diagrams I assumed received
meant "received by the intended recipient", as opposed to "received by the Notification Cmd Handler"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about pending
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's better, although pending
and in-progress
have similar meanings then. Maybe we could change received
to pending
and in-progress
to processing
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I will make this change.
"NotificationCommands" | ||
] | ||
}, | ||
"msgPartition": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required? If so, should it have a different type than null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. It's optionally, so I can remove it from the example. It allows one to override the Kafka partition.
It allows the partitioning to be managed at the application level if required. It was a pretty useful attribute in the Perf PoC. It can be removed.
"endpoint" | ||
], | ||
"properties": { | ||
"endpoint": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoints + params templating looks like it adds a lot of complexity. Does it need to be a part of this? Or could it be handled by a different component? Why can't the ml-api-adapter just spit out an already resolved endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can. Both are supported.
The original idea was to pass additional attributes into the Notification Engine, and also reduce duplicate fields/data by using a templated URI. Using a template in the URI is optional.
It's also possible to still pass parameters even without a template URI as they will be ignored, and thus pass additional attributes to the Notification Cmd Handler which may be useful for future customization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Yeah I'm not too fussed about this, but templating looks like it adds more complexity, and muddies the water a little bit about which component is responsible for generating valid URLs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. It's worth pointing out that it is not difficult to add or remove this functionality.
However, I still believe it's better to not duplicate data....so I am still a fan of the template approach :D
}, | ||
"additionalProperties": false | ||
}, | ||
"traceInfo": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should trace info also be duplicated in the headers? Or will the Notification Event Handler take care of this for us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be handled by the Cmd Handler. It would re-generate the tracing headers with the most recent trace meta-state before sending out the notification.
There is also an argument for it to be handled by the Callback Handler instead. I am leaning towards the first as it will increase the breadth of the trace (i.e. more components that are included in the trace).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I understand. I'm a little wary of messages containing redundant parameters (ie. both in the payload.headers
and traceInfo
fields). Could there be a case where we could have misaligned trace metdata between those 2 fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I understand. I'm a little wary of messages containing redundant parameters (ie. both in the
payload.headers
andtraceInfo
fields). Could there be a case where we could have misaligned trace metdata between those 2 fields?
The headers you see in the example are originally from what was received by the Hub, as such they do NOT reflect the current trace state that is stored within the trace meta-data portion of the message. The propagation of incoming request headers is managed by the API Adapter, so it would be responsible for including or deleting them...the idea being that the incoming request would be "persisted" as-is without any modifications. The outgoing headers are generally mapped from the incoming headers, but certain headers will be deleted or replaced...in this case, the trace headers will be replaced before sending the notification, so I do not see this as an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for clearing that up.
|
||
| Components | Description | APIs | Notes | | ||
| --- | --- | --- | --- | | ||
| ML-Adapter Callback Handler | This component understands the context and semantics of the FSPIOP Specification. Consumes existing Notification (internal) events, then interprets (in context of Mojaloop use-cases) those events into an appropriate event message to some explicit recipient. Also handles feedback loop and compensating actions (defined by configurable rules) from Delivery Reports. It must also resolve any notification details required (i.e. URLs, transport type, etc) by querying the Central-Service's Admin API. This component is pluggable, and the design supports the possibility of several Callback Handlers existing for several specific transports or alternatively to support different context languages like ISO 20022. | N/A | This component is part of the "ML-API-Adapter" | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could there be a need to de-duplicate notification events from central services before they get put on the ml-adapter's notification event que?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not aware of such a requirement, but this is possible. It is also possible to use Kafka to handle this with its "compaction" feature. Perhaps something to be raised in the next DA or Ref Arch meeting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not a requirement, then lets not make more work for ourselves ;). I guess maybe we need to be clear (or maybe we are clear in some documentation somewhere that I'm not aware of) that there is never a case where the central-ledger
could create 2 duplicate notification events.
Link to story: mojaloop/project#1869
Link to working branch: https://github.com/mojaloop/documentation/tree/feature/%231869Designforreliablenotificationsonfinalizationofatransfer/mojaloop-technical-overview/notifications