{"id":32164191,"url":"https://github.com/victorgaiva/rabbitmq-stream","last_synced_at":"2026-02-18T22:01:56.505Z","repository":{"id":54824257,"uuid":"491324093","full_name":"VictorGaiva/rabbitmq-stream","owner":"VictorGaiva","description":"Elixir Client for RabbitMQ Streams Protocol.","archived":false,"fork":false,"pushed_at":"2025-09-30T22:58:59.000Z","size":472,"stargazers_count":28,"open_issues_count":9,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-24T01:59:20.479Z","etag":null,"topics":["client","elixir","rabbitmq","rabbitmq-streams"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VictorGaiva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support-table.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-12T01:27:44.000Z","updated_at":"2025-10-14T15:47:12.000Z","dependencies_parsed_at":"2023-11-23T06:23:26.266Z","dependency_job_id":"37a8dc63-2681-48f7-8b97-5f0107d01c0f","html_url":"https://github.com/VictorGaiva/rabbitmq-stream","commit_stats":{"total_commits":87,"total_committers":1,"mean_commits":87.0,"dds":0.0,"last_synced_commit":"8babda6db01036ae6378af5500a4790ce33c43a1"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/VictorGaiva/rabbitmq-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorGaiva%2Frabbitmq-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorGaiva%2Frabbitmq-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorGaiva%2Frabbitmq-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorGaiva%2Frabbitmq-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VictorGaiva","download_url":"https://codeload.github.com/VictorGaiva/rabbitmq-stream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorGaiva%2Frabbitmq-stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["client","elixir","rabbitmq","rabbitmq-streams"],"created_at":"2025-10-21T14:43:18.543Z","updated_at":"2026-02-18T22:01:56.500Z","avatar_url":"https://github.com/VictorGaiva.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RabbitMQStream\n\n[![Version](https://img.shields.io/hexpm/v/rabbitmq_stream.svg)](https://hex.pm/packages/rabbitmq_stream)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/rabbitmq_stream/)\n[![Download](https://img.shields.io/hexpm/dt/rabbitmq_stream.svg)](https://hex.pm/packages/rabbitmq_stream)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Unit Tests](https://github.com/VictorGaiva/rabbitmq-stream/actions/workflows/ci.yaml/badge.svg)](https://github.com/VictorGaiva/rabbitmq-stream/actions)\n\nElixir Client for [RabbitMQ Streams Protocol](https://www.rabbitmq.com/streams.html).\n\n## Overview\n\nRabbiMQ 3.9 introduced the [Streams](https://www.youtube.com/watch?v=PnmGoMiaJhE) as an alternative to Queues, but differs mainly by implementing a [\"non-destructive consumer semantics\"](https://www.rabbitmq.com/docs/streams#overview). A consumer can read the messages starting at any offset, while receiving new messages.\n\nWhile this feature is avaiable when using the existing Queues, it shines when used with its dedicated protocol, that allows messages to be consumed [extremelly fast](https://youtu.be/PnmGoMiaJhE?si=oHBaa6ml1dGewuvT\u0026t=1125), in comparisson to Queues.\n\nThis library aims to be a Client for the [Streams Protocol](https://www.rabbitmq.com/docs/stream), managing connections and providing an idiomatic way of interacting with all the features avaiable for this functionallity.\n\n## Features\n\n- Producing and Consuming from Streams\n- [Offset Tracking](https://www.rabbitmq.com/blog/2021/09/13/rabbitmq-streams-offset-tracking) and [Control Flow](https://www.rabbitmq.com/docs/stream#flow-control)(Credits) helpers\n- [Stream Filtering](https://www.rabbitmq.com/blog/2023/10/16/stream-filtering)\n- [Single Active Consumer](https://www.rabbitmq.com/blog/2022/07/05/rabbitmq-3-11-feature-preview-single-active-consumer-for-streams)\n- [Super Streams](https://www.rabbitmq.com/blog/2022/07/13/rabbitmq-3-11-feature-preview-super-streams)\n\n## Installation\n\nThe package can be installed by adding `rabbitmq_stream` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:rabbitmq_stream, \"~\u003e 0.4.2\"},\n    # ...\n  ]\nend\n```\n\n## [Producing](https://github.com/VictorGaiva/rabbitmq-stream/blob/main/guides/concepts/producing.md)\n\nRabbitMQ Streams protocol needs a static `:reference_name` per producer. This is used to prevent message duplication. For this reason, each stream needs, for now, a static module to publish messages, which keeps track of its own `publishing_id`.\n\nYou can define a `Producer` module like this:\n\n```elixir\ndefmodule MyApp.MyProducer do\n  use RabbitMQStream.Producer,\n    stream_name: \"stream-01\",\n    connection: MyApp.MyConnection\nend\n```\n\nThen you can publish messages to the stream:\n\n```elixir\nMyApp.MyProducer.publish(\"Hello World\")\n```\n\n## Consuming\n\nFirst you define a connection\n\n```elixir\ndefmodule MyApp.MyConnection do\n  use RabbitMQStream.Connection\nend\n```\n\nYou then can declare a consumer module with the `RabbitMQStream.Consumer`:\n\n```elixir\ndefmodule MyApp.MyConsumer do\n  use RabbitMQStream.Consumer,\n    connection: MyApp.MyConnection,\n    stream_name: \"my_stream\",\n    initial_offset: :first\n\n  @impl true\n  def handle_message(_message) do\n    :ok\n  end\nend\n```\n\nOr you could manually consume from the stream with\n\n```elixir\n{:ok, _subscription_id} = MyApp.MyConnection.subscribe(\"stream-01\", self(), :next, 999)\n```\n\nThe caller process will start receiving messages with the format `{:deliver, %RabbitMQStream.Message.Types.DeliverData{} = deliver_data}`\n\n```elixir\ndef handle_info({:deliver, %RabbitMQStream.Message.Types.DeliverData{} = deliver_data}, state) do\n  # do something with message\n  {:noreply, state}\nend\n```\n\n## [SuperStreams](https://github.com/VictorGaiva/rabbitmq-stream/blob/main/guides/concepts/super-streams.md)\n\n[A super stream is a logical stream made of individual, regular streams.](https://www.rabbitmq.com/blog/2022/07/13/rabbitmq-3-11-feature-preview-super-streams)\n\nYou can declare SuperStreams with:\n\n```elixir\n:ok = MyApp.MyConnection.create_super_stream(\"my_super_stream\", \"route-A\": [\"stream-01\", \"stream-02\"], \"route-B\": [\"stream-03\"])\n```\n\nAnd you can consume from it with:\n\n```elixir\ndefmodule MyApp.MySuperConsumer do\n  use RabbitMQStream.SuperConsumer,\n    initial_offset: :next,\n    super_stream: \"my_super_stream\"\n\n  @impl true\n  def handle_message(_message) do\n    # ...\n    :ok\n  end\nend\n```\n\n### Configuration\n\nThe configuration for the connection can be set in your `config.exs` file:\n\n```elixir\nconfig :rabbitmq_stream, MyApp.MyConnection,\n  username: \"guest\",\n  password: \"guest\"\n  # ...\nend\n\n```\n\nYou can configure a default Serializer module by passing it to the defaults configuration option\n\n```elixir\nconfig :rabbitmq_stream, :defaults,\n  serializer: Jason\nend\n```\n\n### TLS\n\nYou can configure the RabbitmqStream to use TLS connections:\n\n```elixir\ncoonfig :rabbitmq_stream, :defaults,\n  connection: [\n    transport: :ssl,\n    ssl_opts: [\n      keyfile: \"services/cert/client_box_key.pem\",\n      certfile: \"services/cert/client_box_certificate.pem\",\n      cacertfile: \"services/cert/ca_certificate.pem\"\n    ]\n  ]\n```\n\nFor more information, check the [documentation](https://hexdocs.pm/rabbitmq_stream/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorgaiva%2Frabbitmq-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorgaiva%2Frabbitmq-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorgaiva%2Frabbitmq-stream/lists"}