NServiceBus 5.1, RavenDB persistence, AutoFac container, log4net, all latest versions in NuGet at time of posting.
EndpointConfig:
log4net.Co
I figured it out. It was the
freightDataStore.Conventions.IdentityPartsSeparator = "-";
that fooled Raven, since the generated id probably would look something like InvoiceSaga-cdd0b4ed-d310-41fa-a8dd-a3dc00b3942f.
EDIT This can be solved by registering a custom Raven.Client.Converters.ITypeConverter for Guid with the DocumentStore.Conventions.IdentityProviders. See submitted Raven issue and this SO question for more info
But WHY NSB uses the freightDataStore and not the nsbDataStore for persisting the saga I don't know yet. I might have misunderstood how to configure NSB with two different IDataStores registered in the container? Any guidance on this?
EDIT I've created a separate question for this: How to configure NServiceBus with two RavenDB IDocumentStores?