Skip to content

mackenza/solace-samples-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Solace Samples Python

Environment Setup

  1. Install Python 3.7 (See installed version using python3 -V)
    1.1 Note: If you are installing python for the first time on your machine then you can just use python instead of python3 for the commands
  2. [Optional] Install virtualenv python3 -m pip install --user virtualenv
    1.1 Note: on a Linux machine, depending on the distribution you might need to apt-get install python3-venv instead
  3. Clone this repository
  4. [Optional] Setup python virtual environment python3 -m venv venv
  5. [Optional] Activate virtual environment:
    1.1 MacOS/Linux: source venv/bin/activate
    1.2 Windows: source venv/Scripts/activate

Install the Solace Python API

  1. Install the API pip install solace-pubsubplus

Run Samples

Execute the script of choice as follows:

  • python <name_of_file>.py

Note: This assumes you have a local docker broker running on localhost

To pass non default parameters, do so via the environment variables

  • SOLACE_HOST=<host_name> SOLACE_VPN=<vpn_name> SOLACE_USERNAME=<username> SOLACE_PASSWORD=<password> python <name_of_file>.py

Notes:

  1. Python Virtual environment is recommended to keep your project dependencies within the project scope and avoid polluting global python packages
  2. Solace hostname, username, message vpn, and password are obtained from your Solace cloud account

To-Do

  • Add loop for publisher message rate
  • Add License, Authors, Contributing
  • Add pip install solace-pubsubplus when API is released

Resources

Releases

No releases published

Packages

No packages published