Skip to content

Breaking public API change: fold IAutorecoveringConnection [back] into IConnection #943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2020
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
53 changes: 0 additions & 53 deletions projects/RabbitMQ.Client/client/api/IAutorecoveringConnection.cs

This file was deleted.

37 changes: 37 additions & 0 deletions projects/RabbitMQ.Client/client/api/IConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,43 @@ public interface IConnection : INetworkConnection, IDisposable
/// </remarks>
event EventHandler<ShutdownEventArgs> ConnectionShutdown;

/// <summary>
/// Raised when the connection completes recovery.
/// </summary>
/// <remarks>
/// This event will never fire for connections that disable automatic recovery.
/// </remarks>
event EventHandler<EventArgs> RecoverySucceeded;

/// <summary>
/// Raised when the connection recovery fails, e.g. because reconnection or topology
/// recovery failed.
/// </summary>
/// <remarks>
/// This event will never fire for connections that disable automatic recovery.
/// </remarks>
event EventHandler<ConnectionRecoveryErrorEventArgs> ConnectionRecoveryError;

/// <summary>
/// Raised when the server-generated tag of a consumer registered on this connection changes during
/// connection recovery. This allows applications that need to be aware of server-generated
/// consumer tag values to keep track of the changes.
/// </summary>
/// <remarks>
/// This event will never fire for connections that disable automatic recovery.
/// </remarks>
event EventHandler<ConsumerTagChangedAfterRecoveryEventArgs> ConsumerTagChangeAfterRecovery;

/// <summary>
/// Raised when the name of a server-named queue declared on this connection changes during
/// connection recovery. This allows applications that need to be aware of server-named
/// queue names to keep track of the changes.
/// </summary>
/// <remarks>
/// This event will never fire for connections that disable automatic recovery.
/// </remarks>
event EventHandler<QueueNameChangedAfterRecoveryEventArgs> QueueNameChangeAfterRecovery;

event EventHandler<EventArgs> ConnectionUnblocked;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

namespace RabbitMQ.Client.Framing.Impl
{
internal sealed class AutorecoveringConnection : IAutorecoveringConnection
internal sealed class AutorecoveringConnection : IConnection
{
private bool _disposed = false;
private readonly object _eventLock = new object();
Expand Down
30 changes: 29 additions & 1 deletion projects/RabbitMQ.Client/client/impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHa
public event EventHandler<CallbackExceptionEventArgs> CallbackException;

public event EventHandler<ConnectionBlockedEventArgs> ConnectionBlocked;
public event EventHandler<EventArgs> ConnectionUnblocked;

public event EventHandler<ShutdownEventArgs> ConnectionShutdown
{
Expand Down Expand Up @@ -149,10 +150,37 @@ public event EventHandler<ShutdownEventArgs> ConnectionShutdown
}
}

/// <summary>
/// This event is never fired by non-recovering connections but it is a part of the <see cref="IConnection"/> interface.
/// </summary>
public event EventHandler<EventArgs> RecoverySucceeded {
add { }
remove { }
}

/// <summary>
/// This event is never fired by non-recovering connections but it is a part of the <see cref="IConnection"/> interface.
/// </summary>
public event EventHandler<ConnectionRecoveryErrorEventArgs> ConnectionRecoveryError {
add { }
remove { }
}

public event EventHandler<EventArgs> ConnectionUnblocked;
/// <summary>
/// This event is never fired by non-recovering connections but it is a part of the <see cref="IConnection"/> interface.
/// </summary>
public event EventHandler<ConsumerTagChangedAfterRecoveryEventArgs> ConsumerTagChangeAfterRecovery {
add { }
remove { }
}

/// <summary>
/// This event is never fired by non-recovering connections but it is a part of the <see cref="IConnection"/> interface.
/// </summary>
public event EventHandler<QueueNameChangedAfterRecoveryEventArgs> QueueNameChangeAfterRecovery {
add { }
remove { }
}

public string ClientProvidedName { get; }

Expand Down
11 changes: 4 additions & 7 deletions projects/Unit/APIApproval.Approve.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,6 @@ namespace RabbitMQ.Client
string Name { get; }
RabbitMQ.Client.IAuthMechanism GetInstance();
}
public interface IAutorecoveringConnection : RabbitMQ.Client.IConnection, RabbitMQ.Client.INetworkConnection, System.IDisposable
{
event System.EventHandler<RabbitMQ.Client.Events.ConnectionRecoveryErrorEventArgs> ConnectionRecoveryError;
event System.EventHandler<RabbitMQ.Client.Events.ConsumerTagChangedAfterRecoveryEventArgs> ConsumerTagChangeAfterRecovery;
event System.EventHandler<RabbitMQ.Client.Events.QueueNameChangedAfterRecoveryEventArgs> QueueNameChangeAfterRecovery;
event System.EventHandler<System.EventArgs> RecoverySucceeded;
}
public interface IBasicConsumer
{
RabbitMQ.Client.IModel Model { get; }
Expand Down Expand Up @@ -316,8 +309,12 @@ namespace RabbitMQ.Client
System.Collections.Generic.IList<RabbitMQ.Client.ShutdownReportEntry> ShutdownReport { get; }
event System.EventHandler<RabbitMQ.Client.Events.CallbackExceptionEventArgs> CallbackException;
event System.EventHandler<RabbitMQ.Client.Events.ConnectionBlockedEventArgs> ConnectionBlocked;
event System.EventHandler<RabbitMQ.Client.Events.ConnectionRecoveryErrorEventArgs> ConnectionRecoveryError;
event System.EventHandler<RabbitMQ.Client.ShutdownEventArgs> ConnectionShutdown;
event System.EventHandler<System.EventArgs> ConnectionUnblocked;
event System.EventHandler<RabbitMQ.Client.Events.ConsumerTagChangedAfterRecoveryEventArgs> ConsumerTagChangeAfterRecovery;
event System.EventHandler<RabbitMQ.Client.Events.QueueNameChangedAfterRecoveryEventArgs> QueueNameChangeAfterRecovery;
event System.EventHandler<System.EventArgs> RecoverySucceeded;
void Abort();
void Abort(System.TimeSpan timeout);
void Abort(ushort reasonCode, string reasonText);
Expand Down