Exception in RavenDB.SagaPersister.Save, “Guid should contain 32 digits with 4 dashes”. Guid is empty in Raven

前端 未结 1 1702
离开以前
离开以前 2021-01-26 13:12

NServiceBus 5.1, RavenDB persistence, AutoFac container, log4net, all latest versions in NuGet at time of posting.

EndpointConfig:

            log4net.Co         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-26 13:40

    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?

    0 讨论(0)
提交回复
热议问题