@@ -43,6 +43,7 @@ internal sealed class AutorecoveringModel : IFullModel, IRecoverable
43
43
private readonly object _eventLock = new object ( ) ;
44
44
private AutorecoveringConnection _connection ;
45
45
private RecoveryAwareModel _delegate ;
46
+ private List < string > _recordedConsumerTags = new List < string > ( ) ;
46
47
47
48
private EventHandler < BasicAckEventArgs > _recordedBasicAckEventHandlers ;
48
49
private EventHandler < BasicNackEventArgs > _recordedBasicNackEventHandlers ;
@@ -91,6 +92,8 @@ public TimeSpan ContinuationTimeout
91
92
}
92
93
}
93
94
95
+ public IEnumerable < string > ConsumerTags => _recordedConsumerTags ;
96
+
94
97
public AutorecoveringModel ( AutorecoveringConnection conn , RecoveryAwareModel _delegate )
95
98
{
96
99
_connection = conn ;
@@ -476,7 +479,7 @@ public void Close(ShutdownEventArgs reason, bool abort)
476
479
477
480
try
478
481
{
479
- _delegate . Close ( reason , abort ) . GetAwaiter ( ) . GetResult ( ) ; ;
482
+ _delegate . Close ( reason , abort ) . GetAwaiter ( ) . GetResult ( ) ; ;
480
483
}
481
484
finally
482
485
{
@@ -510,6 +513,8 @@ private void Dispose(bool disposing)
510
513
{
511
514
Abort ( ) ;
512
515
516
+ _recordedConsumerTags . Clear ( ) ;
517
+ _recordedConsumerTags = null ;
513
518
_connection = null ;
514
519
_delegate = null ;
515
520
_recordedBasicAckEventHandlers = null ;
@@ -1184,16 +1189,16 @@ public string BasicConsume(
1184
1189
throw new ObjectDisposedException ( GetType ( ) . FullName ) ;
1185
1190
}
1186
1191
1187
- string result = _delegate . BasicConsume ( queue , autoAck , consumerTag , noLocal ,
1192
+ string resultConsumerTag = _delegate . BasicConsume ( queue , autoAck , consumerTag , noLocal ,
1188
1193
exclusive , arguments , consumer ) ;
1189
1194
RecordedConsumer rc = new RecordedConsumer ( this , queue ) .
1190
- WithConsumerTag ( result ) .
1191
1195
WithConsumer ( consumer ) .
1192
1196
WithExclusive ( exclusive ) .
1193
1197
WithAutoAck ( autoAck ) .
1194
1198
WithArguments ( arguments ) ;
1195
- _connection . RecordConsumer ( result , rc ) ;
1196
- return result ;
1199
+ _connection . RecordConsumer ( resultConsumerTag , rc ) ;
1200
+ _recordedConsumerTags . Add ( resultConsumerTag ) ;
1201
+ return resultConsumerTag ;
1197
1202
}
1198
1203
1199
1204
public BasicGetResult BasicGet ( string queue ,
0 commit comments