Send json object to Solace queue using Python

Hi Praveen!

For your solace_url param, don’t include the protocol and the port in your url string, so you can do something along the lines of

url = "<your_domain_name>.solace.cloud"
username = "solace-cloud-client"
password = "<password>"
PORT=1883
client = mqtt.Client()
client.username_pw_set(username=username, password=password)
  #      client.on_connect = on_connect
  #      client.on_message = on_message
client.connect(url, port=PORT )
  #      client.loop_forever()

And a quick side note regarding terminology, using solace you don’t publish to a queue. You connect to the solace broker, publish on a topic and you configure a queue on the broker to subscribe to that topic. Your consuming application will bind to the queue consuming the messages.

Hope this helps! let me know if it doesn’t work (or if it works too) ?