Skip to main content

Provider package apache-airflow-providers-mqtt for Apache Airflow

Project description

apache-airflow-providers-mqtt

Provider for using MQTT with Apache Airflow

Installation

pip install apache-airflow-providers-mqtt

Usage

from __future__ import annotations

from airflow.providers.common.messaging.triggers.msg_queue import MessageQueueTrigger
from airflow.sdk import Asset, AssetWatcher, dag, task

trigger = MessageQueueTrigger(scheme="mqtt", topics="topic/+")

asset = Asset("mqtt_queue_asset", watchers=[AssetWatcher(name="mqtt_watcher", trigger=trigger)])

@dag(schedule=[asset])
def mqtt_example():
    @task()
    def extract_message(triggering_asset_events=None):
        message = list(triggering_asset_events.values())[0][0].extra['payload']
        print(f"Received message: {message}")
        return message
    
    mqtt_msg = extract_message()

mqtt_example()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apache_airflow_providers_mqtt-0.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apache_airflow_providers_mqtt-0.2.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file apache_airflow_providers_mqtt-0.2.0.tar.gz.

File metadata

File hashes

Hashes for apache_airflow_providers_mqtt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ecb44ae375bb9440ba3bffbbca7e9443cf8d8f669565bec375c52a8645d9c2f3
MD5 d910e8370aacde50af3b769dbf0acc77
BLAKE2b-256 110e50e11f2a69d279fcec97325f512b2d640af0f477f5710789c1f17b91a1a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for apache_airflow_providers_mqtt-0.2.0.tar.gz:

Publisher: publish-pypi.yml on gregatm/apache-airflow-providers-mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file apache_airflow_providers_mqtt-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apache_airflow_providers_mqtt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e0f86fb43fd6bcdb54d40f06c4c57f796224a813f3c328b18be0f1b6db5d52c
MD5 73f748bb02e0a1132141228ab796ee3c
BLAKE2b-256 e8fa87e9c0fc57f9e16c51944ae49e253f6c3279851bece0a7a381e05a2c2e81

See more details on using hashes here.

Provenance

The following attestation bundles were made for apache_airflow_providers_mqtt-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yml on gregatm/apache-airflow-providers-mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page