How to change solace client name


Hi all,
On the web portal, my connections showing a random generated client name. I would like to ask how can I assign a more meaningful name on the application side?
I am using python apis. I am using config like this by following the hello_world_pubsub.py > example. Thanks
broker_props = {

“solace.messaging.transport.host”: os.environ.get(‘SOLACE_HOST’) or “tcp://10.40.14.33:20061,tcp://10.40.14.33:20066”,
    “solace.messaging.service.vpn-name”: os.environ.get(‘SOLACE_VPN’) or “default”,
    “solace.messaging.authentication.scheme.basic.username”: os.environ.get(‘SOLACE_USERNAME’) or “default”,
    “solace.messaging.authentication.scheme.basic.password”: os.environ.get(‘SOLACE_PASSWORD’) or “default”
    }

You can pass a “solace.messaging.client.name” > property to your broker_prop object as follows
broker_props = {

"solace.messaging.transport.host": os.environ.get('SOLACE_HOST') or "tcp://10.40.14.33:20061,tcp://10.40.14.33:20066",
"solace.messaging.service.vpn-name": os.environ.get('SOLACE_VPN') or "default",
"solace.messaging.authentication.scheme.basic.username": os.environ.get('SOLACE_USERNAME') or "default",
"solace.messaging.authentication.scheme.basic.password": os.environ.get('SOLACE_PASSWORD') or "default",

“solace.messaging.client.name”: “some meaningful name”
}

You can also check the list of all other properties in the documentation here  solace.messaging.config.solace_properties package — Solace PubSub+ API For Python 2024 documentation
Hopefully this helps!

Hi @Tamimi ,
Thanks for your additional information.
I have tried your suggestion
broker_props = {    “solace.messaging.transport.host”: os.environ.get(‘SOLACE_HOST’) or “tcp://localhost:20061,tcp://localhost:55555,tcp://localhost:55554”,    “solace.messaging.service.vpn-name”: os.environ.get(‘SOLACE_VPN’) or “default”,    “solace.messaging.authentication.scheme.basic.username”: “hello_client”,    “solace.messaging.authentication.scheme.basic.password”: “hello_client_pw”,    “solace.messaging.client.name”: “hello_test_name”    } messaging_service = MessagingService.builder().from_properties(broker_props)\                     .with_reconnection_retry_strategy(RetryStrategy.parametrized_retry(20,3))\                     .build()

The name is still not updated.
I am using python api with version: solace-pubsubplus==1.2.1
I would like to ask if there is anything I missed ?
Thanks

@sulfred Can you please try updating to 1.3 and try again?

Hi @Tamimi ,
Thanks, it works