Raven Subscriptions: Two Document Collections

We are using RavenDB as subscription storage. I am curious why subscriptions seem to end up in two different collections in the Raven Database:

{
“Raven-Entity-Name”: “Subscriptions”,
“Raven-Clr-Type”: “NServiceBus.RavenDB.Persistence.SubscriptionStorage.Subscription, NServiceBus.RavenDB”
}

{
“Raven-Entity-Name”: “Subscription”,
“Raven-Clr-Type”: “NServiceBus.Persistence.Raven.SubscriptionStorage.Subscription, NServiceBus.Core”,
“Temp-Index-Score”: 10.2520237,
“SerializedSizeOnDisk”: 144
}

I can’t see any obvious pattern as to why a specific type ends up in one collection vs. the other.

This is not causing us any problems at runtime. We created a simple tool that allows us to clean up subscriptions in RavenDB, and the tool needs to look at both collections in order to query/delete subscription.

Thanks,

Phil

Hi Phil,

If I recall correctly the Subscription one is the legacy format, probably still NServiceBus 4.x, and the pluralized one is the latest.

@DavidBoike am I missing something?

.m

Yep, there was a snafu about collection name conventions between the embedded version in NServiceBus 4 and the external NServiceBus.RavenDB version. Recent versions will analyze what’s in the database already and then save a collection names document to standardize on one convention. But if you have a mix of RavenDB persistence versions touching the same database, you’ll continue to have the old-style documents popping up. I’m curious what combination of versions is touching the database you’re talking about.

It should just be 5.2.14. However, the endpoint was put into production in NSB 4.x (I think 4.6.x) which would explain it?

Thanks!

Phil

Yep, that would explain it.

-David