Pulserl
An Apache Pulsar client for Erlang/Elixir
Version: 0.1.0
Pulserl is an Erlang client for the Apache Pulsar Pub/Sub system with both producer and consumer implementations. It requires version 2.0+ of Apache Pulsar and 19.0+ of Erlang
Quick Examples
The examples assume you have a running Pulsar broker at localhost:6650, a topic called test-topic (can be partitioned or not) and rebar3 installed.
Note: Pulserl uses pulserl and Shared as the default subscription name and type.
So, if that subscription (not the consumer) under the topic test-topic does not exists, we make sure in this example to create it first by creating
the consumer before producing any message to the topic.
Fetch, compile and start the erlang shell.
git clone https://github.com/skulup/pulserl.git,
cd pulserl
rebar3 shell
In the Erlang shell
rr(pulserl). %% load the api records
%% A demo function to log the value of consumed messages
%% that will be produced blow.
pulserl:start_consumption_in_background("test-topic").
%% Asycnhrounous produce
Promise = pulserl:produce("test-topic", "Asycn produce message").
pulserl:await(Promise). %% Wait broker ack
#messageId{ledger_id = 172,entry_id = 7,
topic = <<"persistent://public/default/test-topic">>,
partition = -1,batch = undefined}
%% Asycnhrounous produce. Response notification is via callback (fun/1)
pulserl:produce("test-topic", "Hello", fun(Res) -> io:format("Response: ~p~n", [Res]) end).
%% Synchronous produce
pulserl:sync_produce("test-topic", "Sync produce message").
#messageId{ledger_id = 176,entry_id = 11,
topic = <<"persistent://public/default/test-topic">>,
partition = -1,batch = undefined}
Feature Matrix
- Basic Producer
- Basic Consumer
- Partitioned topics
- Batching
- Compression
- TLS
- Authentication (token, tls)
- Reader API
- Proxy Support (for Kubernetes)
- Effectively-Once
- Schema
- Consumer seek
- Multi-topics consumer
- Topics regex consumer
- Compacted topics
- User defined properties producer/consumer
- Reader hasMessageAvailable
- Hostname verification
- Multi Hosts Service Url support
- Key_shared
- key based batcher (didn't find a documentation) ?
- Negative Acknowledge
- Delayed Delivery Messages
- Dead Letter Policy
- Interceptors
Thank you Sabudaye for this information
Overview
...
Installation
...
API Examples
...
Contribute
For issues, comments, recommendation or feedback please do it here.
Contributions are highly welcome.
👍