{"id":20511290,"url":"https://github.com/intility/off_broadway_emqtt","last_synced_at":"2025-07-07T07:38:57.675Z","repository":{"id":258968653,"uuid":"856048681","full_name":"intility/off_broadway_emqtt","owner":"intility","description":"An MQTT connector for Broadway based on Emqtt","archived":false,"fork":false,"pushed_at":"2025-01-30T09:25:42.000Z","size":136,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T10:28:18.890Z","etag":null,"topics":["broadway","elixir","mqtt"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intility.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-11T22:37:53.000Z","updated_at":"2025-01-30T09:25:45.000Z","dependencies_parsed_at":"2024-11-15T20:35:37.436Z","dependency_job_id":"e0ad0d6b-d4ed-4035-8495-f3228123e949","html_url":"https://github.com/intility/off_broadway_emqtt","commit_stats":null,"previous_names":["intility/off_broadway_emqtt"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Foff_broadway_emqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Foff_broadway_emqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Foff_broadway_emqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Foff_broadway_emqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intility","download_url":"https://codeload.github.com/intility/off_broadway_emqtt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242117660,"owners_count":20074433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broadway","elixir","mqtt"],"created_at":"2024-11-15T20:35:24.966Z","updated_at":"2025-07-07T07:38:57.635Z","avatar_url":"https://github.com/intility.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OffBroadway.EMQTT\n\n![Elixir CI](https://github.com/Intility/off_broadway_emqtt/actions/workflows/elixir.yaml/badge.svg?event=push\u0026branch=main)\n[![License: Apache 2.0 ](https://img.shields.io/badge/License-Apache2-yellow.svg)](https://opensource.org/license/apache-2-0)\n[![Hex version badge](https://img.shields.io/hexpm/v/off_broadway_emqtt.svg)](https://hex.pm/packages/off_broadway_emqtt)\n[![Hexdocs badge](https://img.shields.io/badge/docs-hexdocs-purple)](https://hexdocs.pm/off_broadway_emqtt/readme.html)\n\nAn MQTT connector based on [emqtt](https://github.com/emqx/emqtt) for [Broadway](https://github.com/dashbitco/broadway).\n\nMQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed for small sensors and mobile devices \nwith limited bandwidth. MQTT is commonly used in IoT (Internet of Things), home and industrial automation, healthcare and energy management\namongst others.\n\nSeveral well-known systems and cloud providers provides MQTT broker services that can be used to build automation systems. These includes\nAmazon Web Services (AWS IoT), Microsoft Azure (IoT Hub, Event Grid), IBM Watson IoT Platform and Eclipse Mosquitto.\n\n## Usage\n\n``` elixir\ndefmodule MyBroadway do \n  use Broadway\n  alias Broadway.Message\n  \n  def start_link(_opts) do \n    Broadway.start_link(__MODULE__,\n      name: __MODULE__,\n      producer: [\n        module: {OffBroadway.EMQTT.Producer, \n           topics: [\n             {\"test/topic1\", :at_most_once},     # QoS 0\n             {\"test/topic2\", :at_least_once},    # QoS 1\n             {\"test/topic3\", :exactly_once}      # QoS 2\n           ],\n           buffer_size: 10_000,                  # Max number of messages in ETS cache before beginning to drop messages\n           buffer_overflow_strategy: :drop_head, # Either :drop_head or :reject\n           buffer_durability: :durable,          # Persist cached messages to disk (:durable) or in-memory only (:transient)\n           buffer_log_dir: System.tmp_dir!(),    # Where to store buffer logs if using :durable buffer\n           config: [\n             host: \"test.mosquitto.org\",\n             port: 1884,\n             username: \"rw\",\n             password: \"readwrite\"\n           ]\n        },\n        concurrency: 5\n      ],\n      processors: [\n        default: [concurrency: 10]\n      ],\n      batchers: [\n        default: [\n          batch_size: 200,\n          concurrency: 5 \n        ]\n      ]\n    )\n  end\n  \n  @impl true\n  def handle_message(_, %Message{} = message, _) do \n    IO.inspect(message, label: \"Handled message from producer\")\n  end\n  \n  @impl true\n  def handle_batch(_, messages, _, _) do \n    IO.inspect(\"Received a batch of #{length(messages)} messages\", label: \"Handled batch from producer\")\n    messages\n  end\nend\n```\n\n\n## Installation\n\nThis package is [available in Hex](https://hex.pm/packages/off_broadway_emqtt), and can be installed\nby adding `off_broadway_emqtt` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:off_broadway_emqtt, \"~\u003e 0.2.0\"}, \n    {:cowlib, \"~\u003e 2.12\", override: true} # Required for `:emqtt` dependency resolution\n  ]\nend\n```\n\nBy default, `:emqtt` compiles the `Quic` library. It is possible to build without by setting the environment variable\n`BUILD_WITHOUT_QUIC=1`.\n\n``` shell\nBUILD_WITHOUT_QUIC=1 mix deps.compile\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintility%2Foff_broadway_emqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintility%2Foff_broadway_emqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintility%2Foff_broadway_emqtt/lists"}