evnu

evnu

Lake - Erlang RabbitMQ Streams Client

Hi!

Some of you may have read the RabbitMQ announcement of Streams.
To quote the announcement:

A RabbitMQ stream models an append-only log with non-destructive consuming
semantics. This means that – contrary to traditional queues in RabbitMQ –
consuming from a stream does not remove messages.

As far as I can tell, there are currently a Java and Go client to connect to RabbitMQ streams, but no Erlang or Elixir client. To take Streams for a spin, we thus wrote a simple Erlang library called lake. The library misses features such as handling clustering, but it works to give streams a try from Erlang and Elixir. See the repository for a usage example.

I hope somebody here finds lake useful!

Most Liked

evnu

evnu

Hi there!

I just released v0.2.0. With this release, all messages from the current protocol specification are supported. That also means that SuperStreams can now be used! The API of lake is very rough around the edges, but playing around with RabbitMQ Streams works.

If you plan to play with SuperStreams, note that a SuperStreams need to be created outside of lake. The binary protocol does not have a command to create SuperStreams. Either use rabbitmqctl, or see lake_SUITE for how to create a SuperStream using AMQP.

evnu

evnu

This is because of the RabbitMQ version. I tested lake’s v0.2 against RabbitMQ 3.11 to make use of SuperStreams. RabbitMQ 3.9 misses the EXCHANGE_COMMAND_VERSIONS command. So, to work around this, use the option {:exchange_command_versions, false} when connecting. This is one of the things where the API of lake is still quite rough around the edges. The following should work:

def connect do
    :lake.connect("localhost", 5552, "guest", "guest", "/", exchange_command_versions: false)
end

With that, you can take a look into lake’s lake_SUITE for some examples on using RabbitMQ Streams.

Note that the RabbitMQ 3.9 release series is EOL. When I run your docker command, I see the following (non-fatal) error message:

2023-03-12 17:27:13.077571+00:00 [error] <0.230.0> This release series has reached end of life and is no longer supported. Please visit https://rabbitmq.com/versions.html to learn more and upgrade

W.r.t. RabbitMQ 3.9 being EOL, maybe I should add a minimal RabbitMQ version supported by lake at some point in time. But a nicer API should have a higher priority.

Where Next?

Popular in Libraries Top

mbuhot
Leverage Open Api 3.0 (Swagger) to document, test, validate and explore your Plug and Phoenix APIs. Generate and serve a JSON Open API ...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
benlime
I created a new library GitHub - benvp/ex_cva: Class Variance Authority for Elixir which aims to make it very easy to define different va...
New
aditya7iyengar
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections. Fo...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 18262 141
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: https://github.com/tmbb/phoenix_ws Phoenix channels are a great...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
381 12391 119
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement