pam18
pam18

Reputation: 33

how to form address string to connect to solace using python

I want to consume messages from a already setup solace broker in my company. When i asked for the host name etc required to connect with solace, below details were provided by my company's solace team-

Connection factory - cf/dev_test_uk
VPN - dev_test_uk
VPN Server - smf://host:port
username - user1
password - password1
topic- testtopic

For reference I am using the code provide at https://github.com/SolaceSamples/solace-samples-amqp-qpid-proton-python

My code is -

from proton import Message
from proton.handlers import MessagingHandler
from proton.reactor import Container

class HelloWorld(MessagingHandler):
    def __init__(self,url,address,username,password):
        super(HelloWorld,self).__init__()
        self.url = url
        self.address = address
        self.username = username
        self.password = password

    def on_start(self,even):
        conn = event.container.connect(url = self.url,
                                       user=self.username,
                                       password=self.password)

        event.container.create_receiver(conn, self.address)

    def on_message(self, event):
        print(event.message.body)
        event.connection.close()


Container(HelloWorld("smf://host:port","topic://testtopic","user1","password1")).run()

when I run this code I get 'amqp:connection:framing-error',"SASL header mismatch:Insufficient data to determine protocol [''] (connection aborted)"

Which is expected as I don't think the url or address string formed is correct. Following are the questions I have-

Please help me with this.

Upvotes: 3

Views: 1054

Answers (1)

ypochien
ypochien

Reputation: 23

Unfortunately.... Solace NO support python module to access Solace Protocol(SMF)....

you can OLNY wrap C API by yourself.....

because I am also need this Python Client API.....

so you can ref our project....

https://pypi.org/project/pysolace/ (WARRNING - unofficial)

Upvotes: 0

Related Questions