Skip to content

Expose DispatchConsumersAsync as a readonly from ConnectionFactory to IConnection #1611

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

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions projects/RabbitMQ.Client/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ RabbitMQ.Client.IConnection.Endpoint.get -> RabbitMQ.Client.AmqpTcpEndpoint
RabbitMQ.Client.IConnection.FrameMax.get -> uint
RabbitMQ.Client.IConnection.Heartbeat.get -> System.TimeSpan
RabbitMQ.Client.IConnection.IsOpen.get -> bool
RabbitMQ.Client.IConnection.DispatchConsumersAsync.get -> bool
RabbitMQ.Client.IConnection.Protocol.get -> RabbitMQ.Client.IProtocol
RabbitMQ.Client.IConnection.QueueNameChangedAfterRecovery -> System.EventHandler<RabbitMQ.Client.Events.QueueNameChangedAfterRecoveryEventArgs>
RabbitMQ.Client.IConnection.RecoveringConsumer -> System.EventHandler<RabbitMQ.Client.Events.RecoveringConsumerEventArgs>
Expand Down
6 changes: 6 additions & 0 deletions projects/RabbitMQ.Client/client/api/IConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public interface IConnection : INetworkConnection, IDisposable
/// </summary>
IEnumerable<ShutdownReportEntry> ShutdownReport { get; }

/// <summary>
/// Returns if connection is set to use asynchronous consumer dispatcher/>.
/// </summary>
public bool DispatchConsumersAsync { get; }

/// <summary>
/// Application-specific connection name, will be displayed in the management UI
/// if RabbitMQ server supports it. This value doesn't have to be unique and cannot
Expand Down Expand Up @@ -236,5 +241,6 @@ Task CloseAsync(ushort reasonCode, string reasonText, TimeSpan timeout, bool abo
/// </summary>
/// <param name="cancellationToken">Cancellation token</param>
Task<IChannel> CreateChannelAsync(CancellationToken cancellationToken = default);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public event EventHandler<RecoveringConsumerEventArgs> RecoveringConsumer

public IProtocol Protocol => Endpoint.Protocol;

public bool DispatchConsumersAsync => _config.DispatchConsumersAsync;

public async ValueTask<RecoveryAwareChannel> CreateNonRecoveringChannelAsync(CancellationToken cancellationToken)
{
ISession session = InnerConnection.CreateSession();
Expand Down
2 changes: 2 additions & 0 deletions projects/RabbitMQ.Client/client/impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ internal Connection(ConnectionConfig config, IFrameHandler frameHandler)
public int LocalPort => _frameHandler.LocalPort;
public int RemotePort => _frameHandler.RemotePort;

public bool DispatchConsumersAsync => _config.DispatchConsumersAsync;

public IDictionary<string, object?>? ServerProperties { get; private set; }

public IEnumerable<ShutdownReportEntry> ShutdownReport => _shutdownReport;
Expand Down