Home > Software design >  How to UnitTest Retry feature of MassTransit
How to UnitTest Retry feature of MassTransit

Time:01-12

I config my application like this:

enter image description here

It worked well, I want to add unit test for my consumer. So, I wonder, is there any way to set up the consumer to ReTry to an expect time in unit test. Like that:

enter image description here

Unfortunately, the consumer is not triggered by UseMessageRetry in StartUp configuration when run by unit test.

Could you help me on this topic?. Thanks.

CodePudding user response:

You'd need to actually configure UseMessageRetry within the OnConfigureInMemoryBus block prior to configuring the receive endpoint.

The first image, with the RabbitMQ configuration, isn't relevant in the second image with the test harness.

  •  Tags:  
  • Related