Fix response message workflow instance correlation (#163)
* Add correlation id to workflow response message * Return message not correlating because of mismatching string formats
This commit is contained in:
parent
e3054b46c8
commit
a7a192cb53
|
|
@ -36,7 +36,9 @@ namespace Sample08.Workflows
|
|||
activity.ValueExpression = new JavaScriptExpression<object>("lastResult().Body");
|
||||
}
|
||||
)
|
||||
.Then<Correlate>(activity => activity.ValueExpression = new LiteralExpression(Guid.NewGuid().ToString("N")))
|
||||
// Need to ensure that the correlation ID is the same string format that is used by the WorkflowConsumer<T>
|
||||
// MassTransit will always use Guid values for correlation ID's, so need to ensure the same string format is used.
|
||||
.Then<Correlate>(activity => activity.ValueExpression = new LiteralExpression(Guid.NewGuid().ToString()))
|
||||
.Then<SendMassTransitMessage>(activity =>
|
||||
{
|
||||
activity.Message = new JavaScriptExpression<CreateOrder>("return { correlationId: correlationId(), order: order};");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Sample08.Workflows
|
|||
.Then<TimerEvent>(activity => activity.TimeoutExpression = new LiteralExpression<TimeSpan>("00:00:05"))
|
||||
.Then<SendMassTransitMessage>(activity =>
|
||||
{
|
||||
activity.Message = new JavaScriptExpression<OrderShipped>("return {order: order}");
|
||||
activity.Message = new JavaScriptExpression<OrderShipped>("return { correlationId: correlationId(), order: order}");
|
||||
activity.MessageType = typeof(OrderShipped);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue