Search code examples
pythonpython-3.xsolace-mq

Python Library to Connect to Solace Queue


I want to send json objects to Solace queue using python. Is there any library in Python to work with Solace queue. If yes, Please let me know the library and how to work with it. Thank you. -Praveen


Solution

  • You can use JSON library from Python, documentation. Assuming you already have the sender and receiver like this example. A simple code is given below:

    import json
    
    # Create a json object
    sample_data = {'name':'Praveen'}
    json_data = json.dumps(sample_data)
    # Use sender
    event.sender.send(json_data)
    

    You can also look at another example and link to code on Github.