Solace Community is getting a facelift!
On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.
We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!
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" }
Best Answers
-
You can pass a
"solace.messaging.client.name"
property to your broker_prop object as followsbroker_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" }
2
Answers
-
You can pass a
"solace.messaging.client.name"
property to your broker_prop object as followsbroker_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" }
2 -
You can also check the list of all other properties in the documentation here https://docs.solace.com/API-Developer-Online-Ref-Documentation/python/source/rst/solace.messaging.config.solace_properties.html?#module-solace.messaging.config.solace_properties
Hopefully this helps!
1 -
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
0