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

Qqwy
Solution is a library to help you with working with ok/error-tuples in case and with-expressions by exposing special matching macros, as ...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
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
cjen07
parameterized pipe in elixir: |n&gt; edit: negative index in |n&gt; and mixed usage with |&gt; are supported example: use ParamP...
New
josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
Crowdhailer
Experimenting with this code. OK.try do user &lt;- fetch_user(1) cart &lt;- fetch_cart(1) order = checkout(cart, user) save_or...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New

Other popular topics Top

Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

Sub Categories:

We're in Beta

About us Mission Statement