コード例 #1
0
 static async Task CreateErrorQueue()
 {
     using (var connection = await ConnectionHelpers.OpenConnection(SqlHelper.ConnectionString)
                             .ConfigureAwait(false))
     {
         var queueManager = new QueueManager("error", connection);
         await queueManager.Create()
         .ConfigureAwait(false);
     }
 }
コード例 #2
0
    public async Task Run()
    {
        await using var connection = Connection.OpenConnectionFromNewClient();
        var manager = new QueueManager("MainQueueCreationTests", connection);
        await manager.Drop();

        await manager.Create();

        await Verifier.Verify(connection)
        .SchemaSettings(includeItem: s => s == "MainQueueCreationTests");
    }
コード例 #3
0
    static async Task CreateTables()
    {
        await using var dbConnection = await ConnectionBuilder();

        var main = new QueueManager("SampleEndpoint", dbConnection);
        await main.Create();

        var delayed = new DelayedQueueManager("SampleEndpoint.Delayed", dbConnection);
        await delayed.Create();

        var subscription = new SubscriptionManager("SubscriptionRouting", dbConnection);
        await subscription.Create();
    }
コード例 #4
0
    public static void Initialize()
    {
        VerifySqlServer.Enable();
        VerifierSettings.ModifySerialization(settings =>
        {
            settings.AddExtraSettings(serializerSettings =>
                                      serializerSettings.TypeNameHandling = TypeNameHandling.Objects);
        });
        SqlHelper.EnsureDatabaseExists(Connection.ConnectionString);
        using var sqlConnection = Connection.OpenConnection();
        var manager = new QueueManager("error", sqlConnection);

        manager.Create().Await();
    }
コード例 #5
0
    public static async Task <EndpointConfiguration> Create(string endpointName)
    {
        await using (var connection = Connection.OpenConnection())
        {
            var manager = new QueueManager(endpointName, connection);
            await manager.Create();
        }

        var configuration = new EndpointConfiguration(endpointName);
        var transport     = configuration.UseTransport <SqlServerTransport>();

        transport.ConnectionString(Connection.ConnectionString);
        transport.Transactions(TransportTransactionMode.SendsAtomicWithReceive);
        transport.NativeDelayedDelivery();
        configuration.PurgeOnStartup(true);
        configuration.UsePersistence <LearningPersistence>();
        configuration.UseSerialization <NewtonsoftSerializer>();
        return(configuration);
    }
コード例 #6
0
    public async Task Run()
    {
        await SqlConnection.DropTable(null, table);

        var manager = new QueueManager(table, SqlConnection);
        await manager.Create();

        var configuration = await EndpointCreator.Create("IntegrationConsumer");

        configuration.SendOnly();
        var endpoint = await Endpoint.Start(configuration);

        await SendStartMessage(endpoint);

        var consumer = new QueueManager(table, SqlConnection);

        await using var message = await consumer.Consume();

        Assert.NotNull(message);
    }