We have had several situations when using Request-Response in state machine sagas and in saga instance that is being persisted, the corresponding request id is set to zero guid.
The request configuration looks like this:
Request(() => IdentifyCustomer, saga => saga.CustomerIdentificationRequestId, c =>
{
c.ServiceAddress = _financeAddress;
c.SchedulingServiceAddress = _schedulerAddress;
c.Timeout = TimeSpan.Zero;
});
The call looks like this:
When(OrderCreated, c => c.Instance.CustomerId == 0)
.Then(c => Log.Debug("Mapping for subscriber for Navision customer id {navisionId} not found", c.Data.NavisionCustomerId))
.Request(IdentifyCustomer, c => new Commands.IdentifyCustomerCmd(c.Instance.NavisionCustomerId))
.TransitionTo(WaitingForSubscriber)
Then in the logs I see the message is being sent with the header value:
RequestId: "1b340000-da2d-1866-07f4-08d413e4b8a4"
I added logging to the saga repository and this is what is being saved (and what I also see in the storage):
{CorrelationId: "b89c3502-9032-49d0-b43b-44147847b181",
CurrentState: "WaitingForSubscriber",
CustomerId: 0,
CustomerIdentificationRequestId: "00000000-0000-0000-0000-000000000000",
Id: "b89c3502-9032-49d0-b43b-44147847b181",
When the response comes, the repository is trying to find saga instance but apparently fails.
We have observed it twice and one time it just went away after we did completely unrelated changes to the code but now we are there and it seems that nothing helps.