Пример #1
0
        protected override void Down(RabbitMqMigrationBuilder migrationBuilder)
        {
            //delete queues
            migrationBuilder.DeleteQueue(PolarisAssignedOnQueueIn);
            migrationBuilder.DeleteQueue(PolarisFishingActivityQueueIn);
            migrationBuilder.DeleteQueue(PolarisMdrQueueIn);
            migrationBuilder.DeleteQueue(PolarisSalesQueueIn);
            migrationBuilder.DeleteQueue(PolarisVesselQueueIn);

            migrationBuilder.DeleteQueue(PolarisAuctionQueueOut);
            migrationBuilder.DeleteQueue(PolarisFluxQueueOut);
            migrationBuilder.DeleteQueue(PolarisMCatchQueueOut);

            migrationBuilder.DeleteQueue(PolarisDeadLetterQueueIn);
            migrationBuilder.DeleteQueue(PolarisDeadLetterQueueOut);

            //delete exchanges
            migrationBuilder.DeleteExchange(PolarisDeadLetterExchangeIn);
            migrationBuilder.DeleteExchange(PolarisDeadLetterExchangeOut);
            migrationBuilder.DeleteExchange(PolarisExchangeIn);
            migrationBuilder.DeleteExchange(PolarisExchangeOut);
        }
        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");
        }
Пример #3
0
 protected override void Down(RabbitMqMigrationBuilder migrationBuilder)
 {
     migrationBuilder.DeleteQueue("bar");
     migrationBuilder.DeleteExchange("foo");
 }
Пример #4
0
 protected override void Down(RabbitMqMigrationBuilder migrationBuilder)
 {
     migrationBuilder.MoveDataToExchange(PolarisAcdrQueueIn, PolarisDeadLetterExchangeIn);
     //delete queues
     migrationBuilder.DeleteQueue(PolarisAcdrQueueIn);
 }