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:
- Could this error be related to the fact that the Solace Messaging library might not support the AMQP protocol or the “amqps” protocol prefix?
- Is there any documentation or information available about whether the Solace Messaging library supports AMQP or “amqps” connections?
- 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))
` `