SzymonPobiega / NServiceBus.Router

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

Question about AzureServiceBusTransport configuration #13

Closed biddlem closed 5 years ago

biddlem commented 5 years ago

I am trying to route Azure Service Bus events in an endpoint-oriented topology to SQS. I am using the mixed-transport template as a starting point.

When my router runs I always get an error about the "MainSerializer" not being set, even though I set it like you do in the AcceptanceTests (https://github.com/SzymonPobiega/NServiceBus.Router/blob/49152c629715deb90f47bb07a94f38ed937c520f/src/NServiceBus.Router.AcceptanceTests/SingleRouter/When_publishing_from_asb_endpoint_oriented.cs#L44).

            var azureServiceBusInterface = routerConfig.AddInterface<AzureServiceBusTransport>("ASB",
                t => {
                    t.ConnectionString(connectionString);
                    t.UseEndpointOrientedTopology();

                    var settings = t.GetSettings();
                    var builder = new ConventionsBuilder(settings);
                    settings.Set<NServiceBus.Conventions>(builder.Conventions);

                    var serializer = Tuple.Create(new NewtonsoftSerializer() as SerializationDefinition, new SettingsHolder());
                    settings.Set("MainSerializer", serializer);
                });

The error fires on this line:

var router = NServiceBus.Router.Router.Create(routerConfig);

I am using NServiceBus 7.1.6 with NServiceBus.Azure.Transports.WindowsAzureServiceBus 9.1.2 and NServiceBus.Router 3.3.0

biddlem commented 5 years ago

Nevermind, the issue was using "new SettingsHolder()" instead of just "settings" on that line.

SzymonPobiega commented 5 years ago

@biddlem Cool. Let me know if you need any help in setting up the router.

masterpoi commented 5 years ago

This bit me too. There is a SettingsHolder from the router and SettingsHolder from NServiceBus.