3

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-

  • where should i use this VPN and connection factory while doing the connections?
  • VPN server url should't it be something like amqp://.... ?

Please help me with this.

pam18
  • 33
  • 2
  • 2
    Looks like they gave you the access parameters (the URL for sure) for the SMF protocol, not AMQP. SMF is the proprietary messaging protocol you can use by downloading the Solace client SDK for supported languages. AMQP is supported, but it accepts connections on your Solace router on a different port (5671/5672 by default) Documentation is here: https://docs.solace.com/Open-APIs-Protocols/AMQP/Using-AMQP.htm https://docs.solace.com/Configuring-and-Managing/Default-Port-Numbers.htm – Szocske Sep 19 '19 at 14:53
  • 2
    ... And this is how your Solace team can enable AMQP for you on the broker in case they haven't yet: https://docs.solace.com/Configuring-and-Managing/AMQP-Tasks/Managing-AMQP-Messaging.htm – Szocske Sep 19 '19 at 15:00

1 Answers1

0

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)

ypochien
  • 23
  • 6