protected override void Up(RabbitMqMigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddTopicExchange("fooTopic").SetDurable(true);
            migrationBuilder.AddDirectExchange("fooDirect").SetDurable(true);
            migrationBuilder.AddFanoutExchange("fooFan").SetDurable(true);
            migrationBuilder.AddHeadersExchange("fooHead").SetDurable(true);
            migrationBuilder.AddExchange("fooDel", ExchangeType.Topic);

            migrationBuilder.AddQueue("bar");
            migrationBuilder.AddQueue("fooQueue");
            migrationBuilder.AddQueue("barDel");

            migrationBuilder.BindExchange("fooTopic", "fooQueue", "#").AddArgument("foo", "bar");
            migrationBuilder.BindQueue("bar", "fooFan", "#").AddArgument("foo", "bar");

            migrationBuilder.MoveDataToQueue("barDel", "bar");
            migrationBuilder.MoveDataToExchange("bar", "fooTopic");

            migrationBuilder.DeleteQueue("barDel").SetIfEmpty(true);
            migrationBuilder.DeleteExchange("fooDel").SetIfUnused(true);

            migrationBuilder.UnbindExchange("fooTopic", "fooQueue", "#").AddArgument("foo", "bar");
            migrationBuilder.UnbindQueue("bar", "fooFan", "#").AddArgument("foo", "bar");
        }
示例#2
0
 protected override void Down(RabbitMqMigrationBuilder migrationBuilder)
 {
     migrationBuilder.MoveDataToExchange(PolarisAcdrQueueIn, PolarisDeadLetterExchangeIn);
     //delete queues
     migrationBuilder.DeleteQueue(PolarisAcdrQueueIn);
 }