Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Testing Message Queue Code: Testcontainers, the MassTransit Test Harness and Contract Tests
Unit test the logic apart from the broker, test broker behavior against a real RabbitMQ with Testcontainers, and wait with signals and bounded polling instead of Task.Delay. The MassTransit test harness, the inactivity cost of negative asserts, a Total→TotalAmount rename silently turning into 0 under default JSON options, and the Microsoft.Testing.Platform setting xUnit v3 needs on .NET 10.
Client Version Migrations: RabbitMQ.Client 6→7 (IModel to IChannel) and MassTransit 8→9
Moving to RabbitMQ.Client 7 gave 5 compiler errors on the first build and 10 more on the second; the real risks are the ones the compiler misses: body lifetime, timeouts becoming cancellations and concurrency. Plus RabbitMQ 4.x rejecting mirroring policies, queue type mismatches, the AMQP 1.0 client, MassTransit 9 refusing to start without a license, v8 support ending on 31 December 2026, and the old Service Bus SDK mapping.