ssue with Solace Messaging Library and "amqps" Host - Error: SOLCLIENT_SUBCODE_UNRESOLVED_HOST

Hello Solace community,

I'm currently working on integrating the Solace Messaging library into my project to establish a connection using the AMQP protocol. However, I'm encountering an error and I'm seeking assistance to understand the root cause and potential solutions.

Issue:I'm trying to connect to an AMQP host using the "amqps" protocol. Here's the host URL I'm using: amqps://xx.tcpe.xx.xx.xx-xx.io:5677

Error Message:I'm receiving the following error message:

SOLCLIENT_SUBCODE_UNRESOLVED_HOST Could not be resolved from session.
An error of type ServiceUnreachableError occurred: Could not be resolved from session.

Question:

  1. Could this error be related to the fact that the Solace Messaging library might not support the AMQP protocol or the "amqps" protocol prefix?
  2. Is there any documentation or information available about whether the Solace Messaging library supports AMQP or "amqps" connections?
  3. If the Solace Messaging library doesn't natively support AMQP, are there any recommended approaches or libraries that I should consider for connecting to an AMQP host securely?

Additional Information:

  • I have reviewed the Solace Messaging library documentation, but I couldn't find specific information about AMQP support.
  • I have checked my configuration settings, and I'm confident that my credentials and configuration are accurate.

Any insights, guidance, or recommendations would be greatly appreciated.

Thank you in advance for your assistance!

Code :

class SolaceClient(AbstractSolaceClient):
      def __init__(self) -> None: 
       self.topic = Topic.of("state/contracts")
# Configure broker properties using configuration values
try: transport_security_strategy = TLS.create().with_certificate_validation( True, validate_server_name=False, trust_store_file_path="renault-ca.pem",)
self.broker_props = {"solace.messaging.transport.host": config.SOLACE_HOST, "solace.messaging.service.vpn-name": config.SOLACE_VPN_NAME, "solace.messaging.service.base-path": "xx/xx/xx/xx", # Add any additional required or optional properties} logging.basicConfig(level=logging.DEBUG) # Create a messaging service instance based on the configured properties
self.messaging_service = (MessagingService.builder() .from_properties(self.broker_props) .with_transport_security_strategy(transport_security_strategy) .with_authentication_strategy(ClientCertificateAuthentication.of(certificate_file="certificate.pem", key_file="privatekey.key",key_password=config.KEY_STORE_PASSWORD,)) .build())self.messaging_service.connect()
except Exception as error: print( "An error of type {} occurred: {}".format(type(error).__name__, error))

Best Answer

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 959 admin
    #2 Answer ✓

    Hi @python_developper,

    You're correct that the Solace python API doesn't support amqp as they are built to be used with Solace SMF. However our brokers do support the AMPQ v1 so you can use a library such as qpid if you prefer to use amqp. A few samples (albeit old) are here: https://github.com/SolaceSamples/solace-samples-amqp-qpid-proton-python.

    Before you go down that route I would suggest you think about your reason for using AMQP as well. It might make more sense to use SMF as it will unlock the full solace feature set. Note that the broker will do protocol translation for you so your app using SMF can still communicate with other apps using AMQP if you have existing amqp applications.


    Hope that helps!

Answers

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 959 admin
    #3 Answer ✓

    Hi @python_developper,

    You're correct that the Solace python API doesn't support amqp as they are built to be used with Solace SMF. However our brokers do support the AMPQ v1 so you can use a library such as qpid if you prefer to use amqp. A few samples (albeit old) are here: https://github.com/SolaceSamples/solace-samples-amqp-qpid-proton-python.

    Before you go down that route I would suggest you think about your reason for using AMQP as well. It might make more sense to use SMF as it will unlock the full solace feature set. Note that the broker will do protocol translation for you so your app using SMF can still communicate with other apps using AMQP if you have existing amqp applications.


    Hope that helps!