Skip to content
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

added connectionName in ConnectionSettings #89

Merged
merged 2 commits into from
Nov 25, 2022
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
1 change: 1 addition & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The class constructor support the following named parameters:
| maxConnectionAttempts | The number of connection attempts till a connection error is reported. Defaults to 1.
| reconnectWaitTime | A [Duration](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:core.Duration) specifying the time between reconnection attempts. Defaults to 1500 ms.
| tuningSettings | A [TuningSettings](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/protocol/io/tuning_settings.dart) instance to use. If not specified, the [default](#tuning-settings) tuning settings will be used.
| connectionName | A client-provided connection name which can help to identify this connection in server logs.

### Authentication providers

Expand Down
4 changes: 4 additions & 0 deletions lib/src/client/connection_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class ConnectionSettings {
SecurityContext? tlsContext;
bool Function(X509Certificate)? onBadCertificate;

// Connection identifier
String? connectionName;

ConnectionSettings({
this.host = "127.0.0.1",
this.port = 5672,
Expand All @@ -42,5 +45,6 @@ class ConnectionSettings {
TuningSettings? tuningSettings,
this.tlsContext,
this.onBadCertificate,
this.connectionName,
}) : tuningSettings = tuningSettings ?? TuningSettings();
}
4 changes: 3 additions & 1 deletion lib/src/client/impl/channel_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ class _ChannelImpl implements Channel {
..clientProperties = {
"product": "Dart AMQP client",
"version": "0.2.3",
"platform": "Dart/${Platform.operatingSystem}"
"platform": "Dart/${Platform.operatingSystem}",
if (_client.settings.connectionName != null)
"connection_name": _client.settings.connectionName!,
}
..locale = 'en_US'
..mechanism = _client.settings.authProvider.saslType
Expand Down