Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ public class ConnectionFactory : ConnectionFactoryBase, IConnectionFactory
public IList<AuthMechanismFactory> AuthMechanisms { get; set; } = DefaultAuthMechanisms;

/// <summary>
/// Set to true to enable automatic connection recovery.
/// Set to false to disable automatic connection recovery.
/// Defaults to true.
/// </summary>
public bool AutomaticRecoveryEnabled { get; set; }
public bool AutomaticRecoveryEnabled { get; set; } = true;

/// <summary>The host to connect to.</summary>
public string HostName { get; set; } = "localhost";
Expand Down Expand Up @@ -230,7 +231,8 @@ public TimeSpan ContinuationTimeout
public SslOption Ssl { get; set; } = new SslOption();

/// <summary>
/// Set to true to make automatic connection recovery also recover topology (exchanges, queues, bindings, etc).
/// Set to false to make automatic connection recovery not recover topology (exchanges, queues, bindings, etc).
/// Defaults to true.
/// </summary>
public bool TopologyRecoveryEnabled { get; set; } = true;

Expand Down
2 changes: 2 additions & 0 deletions projects/client/Unit/src/unit/Fixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ protected AutorecoveringConnection CreateAutorecoveringConnectionWithTopologyRec
protected IConnection CreateNonRecoveringConnection()
{
var cf = new ConnectionFactory();
cf.AutomaticRecoveryEnabled = false;
cf.TopologyRecoveryEnabled = false;
return cf.CreateConnection();
}

Expand Down
2 changes: 1 addition & 1 deletion projects/client/Unit/src/unit/TestChannelAllocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class TestIModelAllocation

public int ModelNumber(IModel model)
{
return ((ModelBase)model).Session.ChannelNumber;
return ((ModelBase)((AutorecoveringModel)model).Delegate).Session.ChannelNumber;
}

[SetUp] public void Connect()
Expand Down
2 changes: 1 addition & 1 deletion projects/client/Unit/src/unit/TestConnectionShutdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void TestShutdownSignalPropagationToChannels()
[Test]
public void TestConsumerDispatcherShutdown()
{
var m = (ModelBase)Model;
var m = (AutorecoveringModel)Model;
var latch = new ManualResetEvent(false);

this.Model.ModelShutdown += (model, args) =>
Expand Down
2 changes: 1 addition & 1 deletion projects/client/Unit/src/unit/TestModelShutdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal class TestModelShutdown : IntegrationFixture
[Test]
public void TestConsumerDispatcherShutdown()
{
var m = (ModelBase)Model;
var m = (AutorecoveringModel)Model;
var latch = new ManualResetEvent(false);

this.Model.ModelShutdown += (model, args) =>
Expand Down