public static async Task CreateQueuesForEndpoint() { var connectionString = @"Data Source=.\SqlExpress;Database=samples;Integrated Security=True"; #region sqlserver-create-queues-shared-usage using (var sqlConnection = new SqlConnection(connectionString)) { await sqlConnection.OpenAsync() .ConfigureAwait(false); await QueueCreationUtils.CreateQueue( connection : sqlConnection, schema : "dbo", queueName : "error") .ConfigureAwait(false); await QueueCreationUtils.CreateQueue( connection : sqlConnection, schema : "dbo", queueName : "audit") .ConfigureAwait(false); } #endregion }
public async Task CreateQueuesForEndpoint() { var connectionString = @"Data Source=.\SqlExpress;Database=samples;Integrated Security=True"; using (var sqlConnection = new SqlConnection(connectionString)) { await sqlConnection.OpenAsync() .ConfigureAwait(false); await CreateEndpointQueues.CreateQueuesForEndpoint( connection : sqlConnection, schema : "dbo", endpointName : "myendpoint") .ConfigureAwait(false); await QueueCreationUtils.CreateQueue( connection : sqlConnection, schema : "dbo", queueName : "error") .ConfigureAwait(false); await QueueCreationUtils.CreateQueue( connection : sqlConnection, schema : "dbo", queueName : "audit") .ConfigureAwait(false); } }
public static async Task CreateQueuesForEndpoint(SqlConnection connection, string schema, string endpointName) { // main queue await QueueCreationUtils.CreateQueue(connection, schema, endpointName) .ConfigureAwait(false); // callback queue await QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.{Environment.MachineName}") .ConfigureAwait(false); // timeout queue await QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.Timeouts") .ConfigureAwait(false); // timeout dispatcher queue await QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.TimeoutsDispatcher") .ConfigureAwait(false); }
public static void CreateQueuesForEndpoint(SqlConnection connection, string schema, string endpointName) { // main queue QueueCreationUtils.CreateQueue(connection, schema, endpointName); // callback queue QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.{Environment.MachineName}"); // timeout queue QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.Timeouts"); // timeout dispatcher queue QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.TimeoutsDispatcher"); // retries queue // TODO: Only required in Versions 2 and below QueueCreationUtils.CreateQueue(connection, schema, $"{endpointName}.Retries"); // delayed messages queue // TODO: Only required in Version 3.1 and above when native delayed delivery is enabled QueueCreationUtils.CreateDelayedQueue(connection, schema, $"{endpointName}.Delayed"); }
public static void CreateQueuesForEndpoint() { var connectionString = @"Data Source=.\SqlExpress;Database=samples;Integrated Security=True"; #region create-queues-shared-usage using (var sqlConnection = new SqlConnection(connectionString)) { sqlConnection.Open(); QueueCreationUtils.CreateQueue( connection: sqlConnection, schema: "dbo", queueName: "error"); QueueCreationUtils.CreateQueue( connection: sqlConnection, schema: "dbo", queueName: "audit"); } #endregion }
public void CreateQueuesForEndpoint() { var connectionString = @"Data Source=.\SqlExpress;Database=Snippets.SqlTransport;Integrated Security=True"; SqlHelper.EnsureDatabaseExists(connectionString); using (var sqlConnection = new SqlConnection(connectionString)) { sqlConnection.Open(); CreateEndpointQueues.CreateQueuesForEndpoint( connection: sqlConnection, schema: "dbo", endpointName: "myendpoint"); QueueCreationUtils.CreateQueue( connection: sqlConnection, schema: "dbo", queueName: "error"); QueueCreationUtils.CreateQueue( connection: sqlConnection, schema: "dbo", queueName: "audit"); } }