Skip to content

Commit b71f65d

Browse files
committed
Resolved merge conflicts after model -> channel rename
1 parent 9ba9cf2 commit b71f65d

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.Recovery.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,26 +354,26 @@ private void RecoverChannelsAndItsConsumers()
354354
private sealed class RecoveryChannelFactory : IDisposable
355355
{
356356
private readonly IConnection _connection;
357-
private IModel? _recoveryChannel;
357+
private IChannel? _recoveryChannel;
358358

359359
public RecoveryChannelFactory(IConnection connection)
360360
{
361361
_connection = connection;
362362
}
363363

364-
public IModel RecoveryChannel
364+
public IChannel RecoveryChannel
365365
{
366366
get
367367
{
368368
if (_recoveryChannel == null)
369369
{
370-
_recoveryChannel = _connection.CreateModel();
370+
_recoveryChannel = _connection.CreateChannel();
371371
}
372372

373373
if (_recoveryChannel.IsClosed)
374374
{
375375
_recoveryChannel.Dispose();
376-
_recoveryChannel = _connection.CreateModel();
376+
_recoveryChannel = _connection.CreateChannel();
377377
}
378378

379379
return _recoveryChannel;

projects/Unit/TestConnectionRecovery.cs

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,15 +1064,15 @@ public void TestTopologyRecoveryQueueFilter()
10641064
var latch = new ManualResetEventSlim(false);
10651065
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryFilter(filter);
10661066
conn.RecoverySucceeded += (source, ea) => latch.Set();
1067-
IModel ch = conn.CreateModel();
1067+
IChannel ch = conn.CreateChannel();
10681068

10691069
var queueToRecover = "recovered.queue";
10701070
var queueToIgnore = "filtered.queue";
10711071
ch.QueueDeclare(queueToRecover, false, false, false, null);
10721072
ch.QueueDeclare(queueToIgnore, false, false, false, null);
10731073

1074-
_model.QueueDelete(queueToRecover);
1075-
_model.QueueDelete(queueToIgnore);
1074+
_channel.QueueDelete(queueToRecover);
1075+
_channel.QueueDelete(queueToIgnore);
10761076

10771077
try
10781078
{
@@ -1108,15 +1108,15 @@ public void TestTopologyRecoveryExchangeFilter()
11081108
var latch = new ManualResetEventSlim(false);
11091109
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryFilter(filter);
11101110
conn.RecoverySucceeded += (source, ea) => latch.Set();
1111-
IModel ch = conn.CreateModel();
1111+
IChannel ch = conn.CreateChannel();
11121112

11131113
var exchangeToRecover = "recovered.exchange";
11141114
var exchangeToIgnore = "filtered.exchange";
11151115
ch.ExchangeDeclare(exchangeToRecover, "topic", false, true);
11161116
ch.ExchangeDeclare(exchangeToIgnore, "direct", false, true);
11171117

1118-
_model.ExchangeDelete(exchangeToRecover);
1119-
_model.ExchangeDelete(exchangeToIgnore);
1118+
_channel.ExchangeDelete(exchangeToRecover);
1119+
_channel.ExchangeDelete(exchangeToIgnore);
11201120

11211121
try
11221122
{
@@ -1152,7 +1152,7 @@ public void TestTopologyRecoveryBindingFilter()
11521152
var latch = new ManualResetEventSlim(false);
11531153
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryFilter(filter);
11541154
conn.RecoverySucceeded += (source, ea) => latch.Set();
1155-
IModel ch = conn.CreateModel();
1155+
IChannel ch = conn.CreateChannel();
11561156

11571157
var exchange = "topology.recovery.exchange";
11581158
var queueWithRecoveredBinding = "topology.recovery.queue.1";
@@ -1168,8 +1168,8 @@ public void TestTopologyRecoveryBindingFilter()
11681168
ch.QueuePurge(queueWithRecoveredBinding);
11691169
ch.QueuePurge(queueWithIgnoredBinding);
11701170

1171-
_model.QueueUnbind(queueWithRecoveredBinding, exchange, bindingToRecover);
1172-
_model.QueueUnbind(queueWithIgnoredBinding, exchange, bindingToIgnore);
1171+
_channel.QueueUnbind(queueWithRecoveredBinding, exchange, bindingToRecover);
1172+
_channel.QueueUnbind(queueWithIgnoredBinding, exchange, bindingToIgnore);
11731173

11741174
try
11751175
{
@@ -1196,7 +1196,7 @@ public void TestTopologyRecoveryConsumerFilter()
11961196
var latch = new ManualResetEventSlim(false);
11971197
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryFilter(filter);
11981198
conn.RecoverySucceeded += (source, ea) => latch.Set();
1199-
IModel ch = conn.CreateModel();
1199+
IChannel ch = conn.CreateChannel();
12001200
ch.ConfirmSelect();
12011201

12021202
var exchange = "topology.recovery.exchange";
@@ -1260,7 +1260,7 @@ public void TestTopologyRecoveryDefaultFilterRecoversAllEntities()
12601260
var latch = new ManualResetEventSlim(false);
12611261
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryFilter(filter);
12621262
conn.RecoverySucceeded += (source, ea) => latch.Set();
1263-
IModel ch = conn.CreateModel();
1263+
IChannel ch = conn.CreateChannel();
12641264
ch.ConfirmSelect();
12651265

12661266
var exchange = "topology.recovery.exchange";
@@ -1287,9 +1287,9 @@ public void TestTopologyRecoveryDefaultFilterRecoversAllEntities()
12871287
consumer2.Received += (source, ea) => consumerLatch2.Set();
12881288
ch.BasicConsume(queue2, true, "filtered.consumer", consumer2);
12891289

1290-
_model.ExchangeDelete(exchange);
1291-
_model.QueueDelete(queue1);
1292-
_model.QueueDelete(queue2);
1290+
_channel.ExchangeDelete(exchange);
1291+
_channel.QueueDelete(queue1);
1292+
_channel.QueueDelete(queue2);
12931293

12941294
try
12951295
{
@@ -1330,25 +1330,25 @@ public void TestTopologyRecoveryQueueExceptionHandler()
13301330
},
13311331
QueueRecoveryExceptionHandler = (rq, ex, connection) =>
13321332
{
1333-
using (var model = connection.CreateModel())
1333+
using (var channel = connection.CreateChannel())
13341334
{
1335-
model.QueueDeclare(rq.Name, false, false, false, changedQueueArguments);
1335+
channel.QueueDeclare(rq.Name, false, false, false, changedQueueArguments);
13361336
}
13371337
}
13381338
};
13391339
var latch = new ManualResetEventSlim(false);
13401340
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryExceptionHandler(exceptionHandler);
13411341
conn.RecoverySucceeded += (source, ea) => latch.Set();
1342-
IModel ch = conn.CreateModel();
1342+
IChannel ch = conn.CreateChannel();
13431343

13441344
var queueToRecoverWithException = "recovery.exception.queue";
13451345
var queueToRecoverSuccessfully = "successfully.recovered.queue";
13461346
ch.QueueDeclare(queueToRecoverWithException, false, false, false, null);
13471347
ch.QueueDeclare(queueToRecoverSuccessfully, false, false, false, null);
13481348

1349-
_model.QueueDelete(queueToRecoverSuccessfully);
1350-
_model.QueueDelete(queueToRecoverWithException);
1351-
_model.QueueDeclare(queueToRecoverWithException, false, false, false, changedQueueArguments);
1349+
_channel.QueueDelete(queueToRecoverSuccessfully);
1350+
_channel.QueueDelete(queueToRecoverWithException);
1351+
_channel.QueueDeclare(queueToRecoverWithException, false, false, false, changedQueueArguments);
13521352

13531353
try
13541354
{
@@ -1362,7 +1362,7 @@ public void TestTopologyRecoveryQueueExceptionHandler()
13621362
finally
13631363
{
13641364
//Cleanup
1365-
_model.QueueDelete(queueToRecoverWithException);
1365+
_channel.QueueDelete(queueToRecoverWithException);
13661366

13671367
conn.Abort();
13681368
}
@@ -1381,25 +1381,25 @@ public void TestTopologyRecoveryExchangeExceptionHandler()
13811381
},
13821382
ExchangeRecoveryExceptionHandler = (re, ex, connection) =>
13831383
{
1384-
using (var model = connection.CreateModel())
1384+
using (var channel = connection.CreateChannel())
13851385
{
1386-
model.ExchangeDeclare(re.Name, "topic", false, false);
1386+
channel.ExchangeDeclare(re.Name, "topic", false, false);
13871387
}
13881388
}
13891389
};
13901390
var latch = new ManualResetEventSlim(false);
13911391
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryExceptionHandler(exceptionHandler);
13921392
conn.RecoverySucceeded += (source, ea) => latch.Set();
1393-
IModel ch = conn.CreateModel();
1393+
IChannel ch = conn.CreateChannel();
13941394

13951395
var exchangeToRecoverWithException = "recovery.exception.exchange";
13961396
var exchangeToRecoverSuccessfully = "successfully.recovered.exchange";
13971397
ch.ExchangeDeclare(exchangeToRecoverWithException, "direct", false, false);
13981398
ch.ExchangeDeclare(exchangeToRecoverSuccessfully, "direct", false, false);
13991399

1400-
_model.ExchangeDelete(exchangeToRecoverSuccessfully);
1401-
_model.ExchangeDelete(exchangeToRecoverWithException);
1402-
_model.ExchangeDeclare(exchangeToRecoverWithException, "topic", false, false);
1400+
_channel.ExchangeDelete(exchangeToRecoverSuccessfully);
1401+
_channel.ExchangeDelete(exchangeToRecoverWithException);
1402+
_channel.ExchangeDeclare(exchangeToRecoverWithException, "topic", false, false);
14031403

14041404
try
14051405
{
@@ -1413,7 +1413,7 @@ public void TestTopologyRecoveryExchangeExceptionHandler()
14131413
finally
14141414
{
14151415
//Cleanup
1416-
_model.ExchangeDelete(exchangeToRecoverWithException);
1416+
_channel.ExchangeDelete(exchangeToRecoverWithException);
14171417

14181418
conn.Abort();
14191419
}
@@ -1436,22 +1436,22 @@ public void TestTopologyRecoveryBindingExceptionHandler()
14361436
},
14371437
BindingRecoveryExceptionHandler = (b, ex, connection) =>
14381438
{
1439-
using (var model = connection.CreateModel())
1439+
using (var channel = connection.CreateChannel())
14401440
{
1441-
model.QueueDeclare(queueWithExceptionBinding, false, false, false, null);
1442-
model.QueueBind(queueWithExceptionBinding, exchange, bindingToRecoverWithException);
1441+
channel.QueueDeclare(queueWithExceptionBinding, false, false, false, null);
1442+
channel.QueueBind(queueWithExceptionBinding, exchange, bindingToRecoverWithException);
14431443
}
14441444
}
14451445
};
14461446
var latch = new ManualResetEventSlim(false);
14471447
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryExceptionHandler(exceptionHandler);
14481448
conn.RecoverySucceeded += (source, ea) => latch.Set();
1449-
IModel ch = conn.CreateModel();
1449+
IChannel ch = conn.CreateChannel();
14501450

14511451
var queueWithRecoveredBinding = "successfully.recovered.queue";
14521452
var bindingToRecoverSuccessfully = "successfully.recovered.binding";
14531453

1454-
_model.QueueDeclare(queueWithExceptionBinding, false, false, false, null);
1454+
_channel.QueueDeclare(queueWithExceptionBinding, false, false, false, null);
14551455

14561456
ch.ExchangeDeclare(exchange, "direct");
14571457
ch.QueueDeclare(queueWithRecoveredBinding, false, false, false, null);
@@ -1460,9 +1460,9 @@ public void TestTopologyRecoveryBindingExceptionHandler()
14601460
ch.QueuePurge(queueWithRecoveredBinding);
14611461
ch.QueuePurge(queueWithExceptionBinding);
14621462

1463-
_model.QueueUnbind(queueWithRecoveredBinding, exchange, bindingToRecoverSuccessfully);
1464-
_model.QueueUnbind(queueWithExceptionBinding, exchange, bindingToRecoverWithException);
1465-
_model.QueueDelete(queueWithExceptionBinding);
1463+
_channel.QueueUnbind(queueWithRecoveredBinding, exchange, bindingToRecoverSuccessfully);
1464+
_channel.QueueUnbind(queueWithExceptionBinding, exchange, bindingToRecoverWithException);
1465+
_channel.QueueDelete(queueWithExceptionBinding);
14661466

14671467
try
14681468
{
@@ -1494,9 +1494,9 @@ public void TestTopologyRecoveryConsumerExceptionHandler()
14941494
},
14951495
ConsumerRecoveryExceptionHandler = (c, ex, connection) =>
14961496
{
1497-
using (var model = connection.CreateModel())
1497+
using (var channel = connection.CreateChannel())
14981498
{
1499-
model.QueueDeclare(queueWithExceptionConsumer, false, false, false, null);
1499+
channel.QueueDeclare(queueWithExceptionConsumer, false, false, false, null);
15001500
}
15011501

15021502
// So topology recovery runs again. This time he missing queue should exist, making
@@ -1507,18 +1507,18 @@ public void TestTopologyRecoveryConsumerExceptionHandler()
15071507
var latch = new ManualResetEventSlim(false);
15081508
AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryExceptionHandler(exceptionHandler);
15091509
conn.RecoverySucceeded += (source, ea) => latch.Set();
1510-
IModel ch = conn.CreateModel();
1510+
IChannel ch = conn.CreateChannel();
15111511
ch.ConfirmSelect();
15121512

1513-
_model.QueueDeclare(queueWithExceptionConsumer, false, false, false, null);
1514-
_model.QueuePurge(queueWithExceptionConsumer);
1513+
_channel.QueueDeclare(queueWithExceptionConsumer, false, false, false, null);
1514+
_channel.QueuePurge(queueWithExceptionConsumer);
15151515

15161516
var recoverLatch = new ManualResetEventSlim(false);
15171517
var consumerToRecover = new EventingBasicConsumer(ch);
15181518
consumerToRecover.Received += (source, ea) => recoverLatch.Set();
15191519
ch.BasicConsume(queueWithExceptionConsumer, true, "exception.consumer", consumerToRecover);
15201520

1521-
_model.QueueDelete(queueWithExceptionConsumer);
1521+
_channel.QueueDelete(queueWithExceptionConsumer);
15221522

15231523
try
15241524
{
@@ -1549,7 +1549,7 @@ public void TestTopologyRecoveryConsumerExceptionHandler()
15491549

15501550
internal bool SendAndConsumeMessage(string queue, string exchange, string routingKey)
15511551
{
1552-
using (var ch = _conn.CreateModel())
1552+
using (var ch = _conn.CreateChannel())
15531553
{
15541554
var latch = new ManualResetEventSlim(false);
15551555

0 commit comments

Comments
 (0)