英文:
The same response type in two requests in MassTransit Saga
问题
I'm trying to create a state machine and I'd like to send multiple requests from this state machine. The requests are defined as follows:
public Request<StageState, ICloseStage, ICloseStageRequestSuccess, IRequestFailed> CloseStageRequest { get; private set; }
public Request<StageState, IPublishStage, IPublishStageRequestSuccess, IRequestFailed> PublishStageRequest { get; private set; }
Both requests might get the same response in Response2
. However, when I'm running the state machine I'm getting the following error:
System.ArgumentException: An item with the same key has already been added. Key: IRequestFailed
So, I suppose this is happening because I'm using IRequestFailed
in both requests. Is it a by-design behavior or is there a workaround so I can use this response type in both requests? I really need to use it in this way because IRequestFailed
is processed in a unified way for all the requests in the state machine, and I'm planning to add more requests.
Thanks in advance.
英文:
I'm trying to create a state machine and I'd like to send multiple requests from this state machine. The requests are defined as follows:
public Request<StageState, ICloseStage, ICloseStageRequestSuccess, IRequestFailed> CloseStageRequest { get; private set; }
public Request<StageState, IPublishStage, IPublishStageRequestSuccess, IRequestFailed> PublishStageRequest { get; private set; }
Both requests might get the same response in Response2
. However, when I'm running the state machine I'm getting the following error:
System.ArgumentException : An item with the same key has already been added. Key: IRequestFailed
So, I suppose this is happening because I'm using IRequestFailed
in both requests. Is it a by-design behavior or is there a workaround so I can use this response type in both requests? I really need to use it in this way because IRequestFailed
is processed in a unified way for all the requests in the state machine, and I'm planning to add more requests.
Thanks in advance.
答案1
得分: 0
MassTransit状态机不支持具有相同响应类型的两个请求。
英文:
The MassTransit state machine does not support two requests with the same response type.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论