Skip to content
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

IExecutionResult should allow for returning a correlation value #47

Open
malclear opened this issue Jan 3, 2022 · 0 comments
Open

IExecutionResult should allow for returning a correlation value #47

malclear opened this issue Jan 3, 2022 · 0 comments

Comments

@malclear
Copy link
Contributor

malclear commented Jan 3, 2022

Problem
When sending multiple commands, we are not able to correlate the IExecutionResult responses received from aggregate managers. This is not a problem when using a synchronous "Ask" from a UI application, but if several commands are sent from a single saga, for example, the responses can't be related to the requests (commands). We have to mitigate failures from within the saga such as by issuing compensating commands or retrying, but cannot.

Potential solution
An optional property, CorrelationId, should be added to IExecutionResult that will indicate which command succeeded or failed. I suggest an IIdentity type, with the expectation the user will return the Command object's ISourceId value.

I considered returning an object rather than IIdentity, but it might tempt users to query on the wrong side of the CQRS divide.

    public interface IExecutionResult
    {
        bool IsSuccess { get; } 
        IIdentity CorrelationId {get;}  // <-- new thing
    }

A solution exists, of course, in that we could create a custom implementation of this interface, but given that it's intended to be an asynchronous response to a request, it seems natural to indicate the request's identity with a correlation value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant