Skip to main content

Messaging Service Client SDK

Client library for accessing the realtime messaging services of the SmartOcean platform.

The messaging services rely on the MQTT Standard

This client SDK implementation utilises the Paho MQTT library. The Paho MQTT library may also be used directly to access the messaging services in case more advanced use is required.

Credentials

Credentials for accessing the messaging service being consumed must be placed in a .env file with the following content

BROKER_USERNAME=<username>
BROKER_PASSWORD=<password>

Configuration

Broker configuration information must be provided in a yaml configuration file with the following format:

BROKER_HOST: 
BROKER_PORT: 
BROKER_TOPIC: 
TOPIC_QOS: 
CLIENT_ID: 

The name of the configuration file in the example below is to be provided as a command-line argument when running the Python application.

Sample Subscriber

A sample implementation accessing the messaging service as a subscriber:

import sfisop.messaging_sdk.subscriber as mqtt_subscriber
import sfisop.messaging_sdk.configuration as mqtt_configuration

import logging

logging.basicConfig(filename='subscriber_client.log',
                    format="%(asctime)s[%(levelname)s]:%(message)s", encoding='utf-8',
                    level=logging.DEBUG)

logging.info("MQTT Subscriber Client module")


class DataConsumer(mqtt_subscriber.SubscriberClient):

    def __init__(self, config_file : str):

        mqtt_client_config = mqtt_configuration.ClientConfiguration(config_file)

        super().__init__(mqtt_client_config)

    def process_one(self, in_message):

        logging.info(f'Data Consumer process_one: {in_message}')


if __name__ == '__main__':

    config_file = mqtt_configuration.get_config_file()

    data_consumer = DataConsumer(config_file)

    data_consumer.run()

Sample Publisher

A sample implementation accessing the messaging service as a publisher:

from sfisop.messaging_sdk.publisher import PublisherClient
from sfisop.messaging_sdk.configuration import ClientConfiguration, get_config_file

if __name__ == '__main__':

    config_file = get_config_file()

    config = ClientConfiguration(config_file)

    publisher_client = PublisherClient(config)

    publisher_client.publish_one("Hello World Publisher Client")

Metadata

Release files for sfisop-messaging-sdk 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sfisop-messaging-sdk 1.0.4
File Size Uploaded Provenance Actions
sfisop_messaging_sdk-1.0.4.tar.gz 4.5 kB Without provenance Details for sfisop_messaging_sdk-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sfisop-messaging-sdk 1.0.4
File Interpreter ABI Platform Actions
sfisop_messaging_sdk-1.0.4-py3-none-any.whl Python 3 none any Details for sfisop_messaging_sdk-1.0.4-py3-none-any.whl

Total release size: 12.0 kB

Release files / sfisop_messaging_sdk-1.0.4.tar.gz

Download URL sfisop_messaging_sdk-1.0.4.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b07d714440b4f23f13b5f840be78834db177c1a850fee8e0e76639b0d6f6f566
BLAKE2b-256 checksum
How to use checksums
0ce909258c0105d3f6c3cb51357f9febe5097f27f530920e531607d52f0c5557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.0 Darwin/24.6.0

Release files / sfisop_messaging_sdk-1.0.4-py3-none-any.whl

Download URL sfisop_messaging_sdk-1.0.4-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fa28b27a88c6a5d4f795cdfe4dd87396fc9f3279b5294bb0490170a3f777970
BLAKE2b-256 checksum
How to use checksums
d1a04cc731f9dfbc941446827734acf016c4ab5b5e1a3b74db59e41c28b6f071
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.0 Darwin/24.6.0

Security for sfisop-messaging-sdk 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page