Closed jmojiwat closed 5 months ago
This is because the in-mem transport in Rebus 8 automatically registers itself as a subscription storage, thus removing the need for the subscriber store above. 🙂
IOW just delete subscriberStore
and remove all uses of it, and you should be good.
OTOH if you WANT to manually handle subscriptions (e.g. for integrations testing one's own subscription storage implementation, etc.), you can make the in-mem transport behave the old way by passing registerSubscriptionStorage: false
to it like this:
services.AddRebus(
configure => configure
.Transport(t => t.UseInMemoryTransport(network, "my-queue", registerSubscriptionStorage: false))
);
I'm a long time fan of Rebus since v3. Recently I wanted to write an integration test as suggested here:
https://github.com/rebus-org/Rebus/wiki/How-to-create-integration-tests
I copy-pasted the code but got an error:
System.InvalidOperationException Attempted to register primary -> Rebus.Subscriptions.ISubscriptionStorage, but a primary registration already exists: primary -> Rebus.Subscriptions.ISubscriptionStorage at Rebus.Injection.Injectionist.Register[TService](Func
2 resolverMethod, Boolean isDecorator, String description) at Rebus.Injection.Injectionist.Register[TService](Func
2 resolverMethod, String description) at Rebus.Config.StandardConfigurer1.Register(Func
2 factoryMethod, String description) at Rebus.Persistence.InMem.InMemorySubscriptionStorageExtensions.StoreInMemory(StandardConfigurer`1 configurer, InMemorySubscriberStore subscriberStore)I've also tried
and received a similar error. Any pointers?
I'm using Rebus 8.1.0 and Rebus.TestHelpers 8.0.0.