centiservice / mats3

Mats3: Message-based Asynchronous Transactional Staged Stateless Services
https://mats3.io/
Other
62 stars 6 forks source link

Make all "to endpoint" arguments require a domain object, not string #76

Open stolsvik opened 1 year ago

stolsvik commented 1 year ago

You would have to provide an instance of ToEndpointId to any initiation and flow which requires endpointId, not String. These ToEndpointId instances would (optionally) only be possible to get hold of during the initialization phase of MatsFactory.

This would give the following massive benefit: One could partially construct the full call graph through the entire MatsFabric up front, not having to rely on logging or other "after the fact" methods. ("Partially" because, depending on implementation, you would not have information about which initiatorId, or stage, actually used the ToEndpointId instance. So you would only know that this service uses said Endpoint, not which initiation or endpoint-stage uses it. One could make it possible to specifically request a ToEndpointId in the context of a stage, and even an initiation-point. The latter could possibly both contain the to endpointId and the initiatorId)

This solution would immediately make it possible to answer "is this endpoint still in use"? You'd query all the MatsFactories, and find which service(s) registers that endpointId as a "ToEndpointId".

(This solution came up in a "what endpoints are in use" discussion with Kristian Hiim)