A robust, containerized Python demonstration for connecting to Solace PubSub+ Cloud. This project provides indepedent examples for Basic Authentication and mTLS (Client Certificate) Authentication.
- Solace PubSub+ Cloud Account: You need a running service.
- Docker Desktop: Installed and running.
- Copy the example:
cp .env.example .env - Fill in your details from Solace Cloud "Connect" tab.
docker build -t solace-demo-app .Connects using Username/Password and listens for messages.
docker run --env-file .env -it --rm solace-demo-app python subscriber.pyThis script publisher.py uses Username and Password from .env.
docker run --env-file .env -it --rm solace-demo-app python publisher.pyThis script publisher_mtls.py uses Client Certificates and ignores the password.
- Generate Certs: See CERTIFICATES.md.
- Mount Certs:
docker run -v $(pwd)/certs:/certs --env-file .env -it --rm solace-demo-app python publisher_mtls.pyNote: This script prints Auth: Client Certificate (No Password) to confirm it is not using the password field.
- Totally Independent Scripts:
publisher.pyandpublisher_mtls.pyshare no code, demonstrating the distinct verification methods. - Paho MQTT v2: Uses the latest library version.
- Containerized: Runs anywhere Docker runs.