Skip to content

Commit faa6907

Browse files
Merge branch 'rabbitmq-dotnet-client-50' into stable
2 parents d21ab6b + 134905d commit faa6907

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

projects/client/Unit/src/unit/TestConnectionRecovery.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,29 @@ public void TestClientNamedQueueRecoveryOnServerRestart()
187187
}, s);
188188
}
189189

190+
[Test]
191+
public void TestConsumerWorkServiceRecovery()
192+
{
193+
AutorecoveringConnection c = CreateAutorecoveringConnection();
194+
IModel m = c.CreateModel();
195+
string q = m.QueueDeclare("dotnet-client.recovery.consumer_work_pool1",
196+
false, false, false, null).QueueName;
197+
var cons = new EventingBasicConsumer(m);
198+
m.BasicConsume(q, true, cons);
199+
AssertConsumerCount(m, q, 1);
200+
201+
CloseAndWaitForRecovery();
202+
203+
Assert.IsTrue(m.IsOpen);
204+
var latch = new ManualResetEvent(false);
205+
cons.Received += (s, args) => latch.Set();
206+
207+
m.BasicPublish("", q, null, encoding.GetBytes("msg"));
208+
Wait(latch);
209+
210+
m.QueueDelete(q);
211+
}
212+
190213
[Test]
191214
public void TestConsumerRecoveryOnClientNamedQueueWithOneRecovery()
192215
{

0 commit comments

Comments
 (0)