We are currently looking into enabling the outbox for our applications.
Our system has a dedicated nServiceBus SQL database server, which contains the message queues. Our application endpoints are configured to create queues in this nServiceBus database server and move messages (command,events) there via SQL Server Transport.
.UseCustomConfiguration(endpointConfiguration =>
{
var connectionString = "server=NServiceBusServer;Database=NServiceBusDb;";
var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
transport.ConnectionString(connectionString);
transport.DefaultSchema("dbo");
transport.Transactions(TransportTransactionMode.ReceiveOnly);
var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
var dialect = persistence.SqlDialect<SqlDialect.MsSqlServer>();
dialect.Schema("dbo");
persistence.ConnectionBuilder(connectionBuilder: () =>
new Microsoft.Data.SqlClient.SqlConnection(connectionString));
// ... some irrelevant logic regarding the subscription table
/*
* Below settings are problematic. OutboxData should be created with another connectionstring
* e.g, "server=ApplicationServer;Database=ApplicationDb;"
*/
endpointConfiguration.EnableInstallers();
endpointConfiguration.EnableOutbox();
})
Our applications have their own application SQL database servers with business data. With Outbox, we expect that the endpoint creates and uses an OutboxData-table in our application database.
However, our endpoints are creating the OutboxData-table in our nServicebus database instead and not in our application database.
We believe we still need to configure an additional connection(string) to tell the endpoint that the OutboxData-table should be used in the application database server and not in the nServiceBus database. Currently, our endpoint only knows the connectionstring to the nServiceBus database. I think it reuses this connectionstring for all database operations, including writing into and polling the Outbox.
Question: Are there any pointers or reference documentation on how to do this?
We already checked the following sources, but this situation doesn’t appear to be covered there: