@@ -200,6 +200,7 @@ pub struct Client {
200
200
tune_notifier : Arc < Notify > ,
201
201
publish_sequence : Arc < AtomicU64 > ,
202
202
filtering_supported : bool ,
203
+ client_properties : HashMap < String , String > ,
203
204
}
204
205
205
206
impl Client {
@@ -227,8 +228,29 @@ impl Client {
227
228
tune_notifier : Arc :: new ( Notify :: new ( ) ) ,
228
229
publish_sequence : Arc :: new ( AtomicU64 :: new ( 1 ) ) ,
229
230
filtering_supported : false ,
231
+ client_properties : HashMap :: new ( ) ,
230
232
} ;
231
233
234
+ client
235
+ . client_properties
236
+ . insert ( String :: from ( "product" ) , String :: from ( "RabbitMQ" ) ) ;
237
+ client
238
+ . client_properties
239
+ . insert ( String :: from ( "platform" ) , String :: from ( "Rust" ) ) ;
240
+ client. client_properties . insert (
241
+ String :: from ( "copyright" ) ,
242
+ String :: from ( "Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries." ) ) ;
243
+ client. client_properties . insert (
244
+ String :: from ( "information" ) ,
245
+ String :: from (
246
+ "Licensed under the Apache 2.0 and MPL 2.0 licenses. See https://www.rabbitmq.com/" ,
247
+ ) ,
248
+ ) ;
249
+ client. client_properties . insert (
250
+ String :: from ( "connection_name" ) ,
251
+ client. opts . client_provided_name . clone ( ) ,
252
+ ) ;
253
+
232
254
client. initialize ( receiver) . await ?;
233
255
234
256
let command_versions = client. exchange_command_versions ( ) . await ?;
@@ -676,7 +698,7 @@ impl Client {
676
698
677
699
async fn peer_properties ( & self ) -> Result < HashMap < String , String > , ClientError > {
678
700
self . send_and_receive :: < PeerPropertiesResponse , _ , _ > ( |correlation_id| {
679
- PeerPropertiesCommand :: new ( correlation_id, HashMap :: new ( ) )
701
+ PeerPropertiesCommand :: new ( correlation_id, self . client_properties . clone ( ) )
680
702
} )
681
703
. await
682
704
. map ( |peer_properties| peer_properties. server_properties )
0 commit comments