Main interface to an AMQP connection.
public interface IConnection : INetworkConnection, IAsyncDisposable, IDisposable
The maximum channel number this connection supports (0 if unlimited). Usable channel numbers range from 1 to this number, inclusive.
ushort ChannelMax { get; }
Property Value
A copy of the client properties that has been sent to the server.
IDictionary<string, object?> ClientProperties { get; }
Property Value
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 be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable.
string? ClientProvidedName { get; }
Property Value
Returns null if the connection is still in a state where it can be used, or the cause of its closure otherwise.
ShutdownEventArgs? CloseReason { get; }
Property Value
Retrieve the endpoint this connection is connected to.
AmqpTcpEndpoint Endpoint { get; }
Property Value
The maximum frame size this connection supports (0 if unlimited).
Property ValueThe current heartbeat setting for this connection (System.TimeSpan.Zero for disabled).
TimeSpan Heartbeat { get; }
Property Value
Returns true if the connection is still in a state where it can be used. Identical to checking if CloseReason equal null.
Property ValueThe IProtocol this connection is using to communicate with its peer.
IProtocol Protocol { get; }
Property Value
A dictionary of the server properties sent by the server while establishing the connection. This typically includes the product name and version of the server.
IDictionary<string, object?>? ServerProperties { get; }
Property Value
Returns the list of ShutdownReportEntry objects that contain information about any errors reported while closing the connection in the order they appeared
IEnumerable<ShutdownReportEntry> ShutdownReport { get; }
Property Value
Asynchronously close this connection and all its channels and wait with a timeout for all the in-progress close operations to complete.
Task CloseAsync(ushort reasonCode, string reasonText, TimeSpan timeout, bool abort, CancellationToken cancellationToken = default)
Parameters
reasonCode
ushort
The close code (See under "Reply Codes" in the AMQP 0-9-1 specification).
reasonText
string
A message indicating the reason for closing the connection.
timeout
TimeSpan
abort
bool
Whether or not this close is an abort (ignores certain exceptions).
cancellationToken
CancellationToken
Cancellation token
Asynchronously create and return a fresh channel, session, and channel.
Task<IChannel> CreateChannelAsync(CreateChannelOptions? options = null, CancellationToken cancellationToken = default)
Parameters
options
CreateChannelOptions
The channel creation options.
cancellationToken
CancellationToken
Cancellation token
This method updates the secret used to authenticate this connection. It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
Task UpdateSecretAsync(string newSecret, string reason, CancellationToken cancellationToken = default)
Parameters
newSecret
string
The new secret.
reason
string
The reason for the secret update.
cancellationToken
CancellationToken
Cancellation token
Signalled when an exception occurs in a callback invoked by the connection.
event AsyncEventHandler<CallbackExceptionEventArgs> CallbackExceptionAsync
Event Type
Raised when a connection is blocked by the AMQP broker.
event AsyncEventHandler<ConnectionBlockedEventArgs> ConnectionBlockedAsync
Event Type
Raised when the connection recovery fails, e.g. because reconnection or topology recovery failed.
event AsyncEventHandler<ConnectionRecoveryErrorEventArgs> ConnectionRecoveryErrorAsync
Event Type
Raised when the connection is destroyed.
event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdownAsync
Event Type
Raised when a connection is unblocked by the AMQP broker.
event AsyncEventHandler<AsyncEventArgs> ConnectionUnblockedAsync
Event Type
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.
event AsyncEventHandler<ConsumerTagChangedAfterRecoveryEventArgs> ConsumerTagChangeAfterRecoveryAsync
Event Type
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.
event AsyncEventHandler<QueueNameChangedAfterRecoveryEventArgs> QueueNameChangedAfterRecoveryAsync
Event Type
Raised when a consumer is about to be recovered. This event raises when topology recovery is enabled, and just before the consumer is recovered. This allows applications to update the consumer arguments before the consumer is recovered. It could be particularly useful when consuming from a stream queue, as it allows to update the consumer offset argument just before the consumer is recovered.
event AsyncEventHandler<RecoveringConsumerEventArgs> RecoveringConsumerAsync
Event Type
Raised when the connection completes recovery.
event AsyncEventHandler<AsyncEventArgs> RecoverySucceededAsync
Event Type
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4