public static async Task DeleteSharedQueues() { var connectionString = @"Data Source=.\SqlExpress;Database=samples;Integrated Security=True"; #region sqlserver-delete-queues-shared-usage using (var sqlConnection = new SqlConnection(connectionString)) { await sqlConnection.OpenAsync() .ConfigureAwait(false); await QueueDeletionUtils.DeleteQueue( connection : sqlConnection, schema : "dbo", queueName : "audit") .ConfigureAwait(false); await QueueDeletionUtils.DeleteQueue( connection : sqlConnection, schema : "dbo", queueName : "error") .ConfigureAwait(false); } #endregion }
public void DeleteSharedQueues() { var connectionString = @"Data Source=.\SqlExpress;Database=samples;Integrated Security=True"; using (var sqlConnection = new SqlConnection(connectionString)) { sqlConnection.Open(); QueueDeletionUtils.DeleteQueue( connection: sqlConnection, schema: "dbo", queueName: "audit"); QueueDeletionUtils.DeleteQueue( connection: sqlConnection, schema: "dbo", queueName: "error"); } }
public static async Task DeleteQueuesForEndpoint(SqlConnection connection, string schema, string endpointName) { // main queue await QueueDeletionUtils.DeleteQueue(connection, schema, endpointName) .ConfigureAwait(false); // callback queue await QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.{Environment.MachineName}") .ConfigureAwait(false); // timeout queue await QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.Timeouts") .ConfigureAwait(false); // timeout dispatcher queue await QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.TimeoutsDispatcher") .ConfigureAwait(false); }
public static void DeleteQueuesForEndpoint(SqlConnection connection, string schema, string endpointName) { // main queue QueueDeletionUtils.DeleteQueue(connection, schema, endpointName); // callback queue QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.{Environment.MachineName}"); // timeout queue QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.Timeouts"); // timeout dispatcher queue QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.TimeoutsDispatcher"); // retries queue // TODO: Only required in Versions 2 and below QueueDeletionUtils.DeleteQueue(connection, schema, $"{endpointName}.Retries"); }
public static void DeleteSharedQueues() { var connectionString = @"Data Source=.\SqlExpress;Database=samples;Integrated Security=True"; #region sqlserver-delete-queues-shared-usage using (var connection = new SqlConnection(connectionString)) { connection.Open(); QueueDeletionUtils.DeleteQueue( connection: connection, schema: "dbo", queueName: "audit"); QueueDeletionUtils.DeleteQueue( connection: connection, schema: "dbo", queueName: "error"); } #endregion }