コード例 #1
0
    public async Task CreateQueuesForEndpoint()
    {
        var connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=samples;Integrated Security=True";

        using (var sqlConnection = new SqlConnection(connectionString))
        {
            await sqlConnection.OpenAsync()
            .ConfigureAwait(false);

            await QueueCreation.CreateQueuesForEndpoint(
                connection : sqlConnection,
                schema : "dbo",
                endpointName : "myendpoint")
            .ConfigureAwait(false);

            await QueueCreation.CreateQueue(
                connection : sqlConnection,
                schema : "dbo",
                queueName : "error")
            .ConfigureAwait(false);

            await QueueCreation.CreateQueue(
                connection : sqlConnection,
                schema : "dbo",
                queueName : "audit")
            .ConfigureAwait(false);
        }
    }
コード例 #2
0
    public void CreateQueuesForEndpoint()
    {
        QueueCreation.CreateQueuesForEndpoint(
            uri: "amqp://*****:*****@localhost:5672",
            endpointName: "myendpoint",
            durableMessages: true,
            createExchanges: true);

        QueueCreation.CreateQueue(
            uri: "amqp://*****:*****@localhost:5672",
            queueName: "error",
            durableMessages: true,
            createExchange: true);

        QueueCreation.CreateQueue(
            uri: "amqp://*****:*****@localhost:5672",
            queueName: "audit",
            durableMessages: true,
            createExchange: true);
    }
コード例 #3
0
    public void CreateQueuesForEndpoint()
    {
        string connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=samples;Integrated Security=True";

        using (SqlConnection sqlConnection = new SqlConnection(connectionString))
        {
            sqlConnection.Open();
            QueueCreation.CreateQueuesForEndpoint(
                connection: sqlConnection,
                schema: "dbo",
                endpointName: "myendpoint");

            QueueCreation.CreateQueue(
                connection: sqlConnection,
                schema: "dbo",
                queueName: "error");

            QueueCreation.CreateQueue(
                connection: sqlConnection,
                schema: "dbo",
                queueName: "audit");
        }
    }