Hi all, am new to Solace and really struggling with the documentation.
Have created a cloud account with a Cluster as per the demo video. Trying the ‘try me’ within the browser works a treat (thou i am yet to find the config option for try-me to have guaranteed queue option?)
Anyhow, looking at the Python demo’s, i have pip install solace-pubsubplus.
I have then copied the api archive to my local test folder, solace\messaging\etc.
This in itself seems odd the messaging service is not part of the package but a custom add-on, is this correct?
My import is working and i am following the example code within the test, i.e. Solace, Solace Python API, SMF protocol, Connect to the service…
Firstly the demo code doesnt include any imports needed? - odd for an intro demo…
For the most basic have worked out:
from solace.messaging.messaging_service import MessagingService, RetryStrategy
Using the demo code for the most basic example then fails:
`broker_props = {
“solace.messaging.transport.host”: “”,
“solace.messaging.service.vpn-name”: “test-service”,
“solace.messaging.authentication.scheme.basic.username”: “solace-cloud-client”,
“solace.messaging.authentication.scheme.basic.password”: “xxxxxxxxxxxxx”,
}
messaging_service = MessagingService.builder().from_properties(broker_props)
.with_reconnection_retry_strategy(RetryStrategy.parametrized_retry(20,3))
.build()
messaging_service.connect()`
(The demo was also missing the \ so that the ‘.’ for the message_service create a python error as default)
Running this (Using Python 3.9.5) I get the error:
2022-01-05 11:31:52,994 [ERROR] solace.messaging.core: [_solace_session.py:664] [[SERVICE: 0x2702cc38fa0] - [APP ID: app_e47cc0a0-xxxx-xxxx-xxxx-459646edb092]] SOLCLIENT_SUBCODE_PARAM_OUT_OF_RANGE
Traceback (most recent call last):
File “C:\Users\xxxx\Desktop\Solace\test.py”, line 20, in
messaging_service = MessagingService.builder().from_properties(broker_props)
File “C:\Users\xxxx\Desktop\Solace\solace\messaging\messaging_service.py”, line 1047, in build
return _BasicMessagingService(config=self._stored_config, application_id=application_id)
File “C:\Users\xxxxx\Desktop\Solace\solace\messaging\messaging_service.py”, line 548, in init
self._api.create_session(self._config) # create the session as part of Messaging Service build process
File “C:\Users\xxxx\Desktop\Solace\solace\messaging\core_solace_session.py”, line 676, in create_session
raise PubSubPlusCoreClientError(message=core_exception_msg, sub_code=info_sub_code)
solace.messaging.errors.pubsubplus_client_error.PubSubPlusCoreClientError: {‘caller_description’: ‘Session Creation’, ‘return_code’: ‘Fail’, ‘sub_code’: ‘SOLCLIENT_SUBCODE_PARAM_OUT_OF_RANGE’, ‘error_info_sub_code’: 1, ‘error_info_contents’: “Session ‘(c0,s1)_test-service’ configuration property ‘SESSION_HOST’ has invalid part ‘’”}
Trying the other examples, with Secured SMF and Compressed SMF also produce errors.
Praying someone can point me in the right direction.
Thank you