SzymonPobiega / NServiceBus.Router

Cross-transport, cross-site and possibly cross-cloud router component for NServiceBus
MIT License
5 stars 10 forks source link

Use RavenDb subscription persistence along with NServiceBus.Router and msmq transport #21

Closed alshov closed 4 years ago

alshov commented 4 years ago

I use MSMQ to Azure Service Bus route. During MSMQ interface setup I need to setup subscription persistence: var subscriptionStorage = new InMemorySubscriptionStorage(); msmqInterface.EnableMessageDrivenPublishSubscribe(subscriptionStorage);

I see there is sql subscription persistence implementation out of the box. Is there anything similar for RavenDb? Is it possible to use RavenDb subscription persistence from NServiceBus.RavenDb nuget package without custom 'ISubscriptionStorage' implementation?

SzymonPobiega commented 4 years ago

Hey @alshov . Do not use the in-memory one in production because you will be losing messages if your router crashes and restarts. Unfortunately the only available subscription persistence for the Router is based on SQL. You can't use regular NSB persistence even though the Router uses the same interface because NSB persistence abstraction requires a regular NServiceBus endpoint to be configured.

Given the limited resources (the Router is being developed as OSS project) I have no plans to add different persistence types. That said, it should be quite simple for you to take the subscription persistence implementation from NServiceBus.RavenDB and copy the code to your Router project.