From the documentation I can’t find a way to tell ServiceControl which database schema to use. Ours is named ‘transport’, but after creating the SC instance it uses ‘dbo’ (e.g. created different error queues, than the endpoints use).
How can I tell ServiceControl which database schema to use for the SQL Server Transport?
Can this be used for the Endpoints instead of the ‘DefaultSchema()’ of the transport configuration as well? So that we would only need to have 1 connection string per environment for all uses, SC and endpoints
Unfortunately not out of the box. You would have to write code like the following for your endpoints
var builder = new DbConnectionStringBuilder
{
ConnectionString = connectionString
};
if (builder.TryGetValue(queueSchemaName, out var customSchema))
{
builder.Remove(queueSchemaName);
transport.DefaultSchema((string)customSchema);
}
transport.ConnectionString(builder.ConnectionString);
Hope that helps. have a nice day and don’t melt away!
I am using ServiceControl 1.47.5 and also provided queue schema in the connection string but still when I retry exception message from ServiceInsight I am getting error for invalid object and it always look queue in dbo schema.
ServiceBus.Unicast.Queuing.QueueNotFoundException: Failed to send message to address: [xxx.xxx.xxxx] ---> System.Data.SqlClient.SqlException: Invalid object name 'dbo.xxx.xxx.xxxx'.