1
0
mirror of synced 2024-11-05 02:59:16 +00:00

Fixed Tapeti not reconnecting after a disconnect event unless Publish is called

This commit is contained in:
Mark van Renswoude 2019-08-08 11:56:10 +02:00
parent 263e364a84
commit d17f4f3a9f

View File

@ -34,6 +34,7 @@ namespace Tapeti.Connection
// These fields are for use in the taskQueue only!
private RabbitMQ.Client.IConnection connection;
private bool isClosing;
private bool isReconnect;
private IModel channelInstance;
private ulong lastDeliveryTag;
@ -173,6 +174,8 @@ namespace Tapeti.Connection
return taskQueue.Value.Add(() =>
{
isClosing = true;
if (channelInstance != null)
{
channelInstance.Dispose();
@ -371,6 +374,9 @@ namespace Tapeti.Connection
});
channelInstance = null;
if (!isClosing)
taskQueue.Value.Add(() => WithRetryableChannel(channel => { }));
};
channelInstance.BasicReturn += HandleBasicReturn;