SzymonPobiega / NServiceBus.Bridge

A bridge that can connect endpoints using different NServiceBus transports
MIT License
4 stars 3 forks source link

Example using outbox #6

Open markgould opened 7 years ago

markgould commented 7 years ago

Is there anything special needed to enable Outbox when using Bridge? I'm getting DTC errors. This is how I am configuring the endpoint:

public Task Start()
        {
            var taxConnection = ConfigurationManager.ConnectionStrings["Tax"].ConnectionString;            
            var config = NServiceBus.Bridge.Bridge.Between<SqlServerTransport>("MainBridge", t => t.ConnectionStringName("NSB"))
                .And<SqlServerTransport>("LegacyBridge", t => t.ConnectionString(taxConnection).DefaultSchema("nsb"));

            config.UseSubscriptionPersistece<SqlPersistence>((e, c) =>
            {                
                c.SqlVariant(SqlVariant.MsSqlServer);
                c.ConnectionBuilder(() => new SqlConnection(taxConnection));
                c.Schema("nsb");
                c.SubscriptionSettings().DisableCache();                
                e.EnableInstallers();
                e.EnableOutbox();
            });
            config.AutoCreateQueues();
            _bridge = config.Create();
            return _bridge.Start();
        }
SzymonPobiega commented 7 years ago

@markgould Unfortunately the bridge does not support the outbox. But if your endpoints on both sides of the bridge have the outbox enabled then everything will be fine as the bridge preserves messages IDs essential for the outbox deduplication.