Project

pulsar_sdk

0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A pure ruby client for Apache Pulsar
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

> 1.17
> 10

Runtime

 Project Readme

A pure ruby client for Apache Pulsar

Respecting Pulsar binary protocol specification

Example

See examples.

Dev

I am using Ruby 2.4 develop this gem, if not work with other Ruby version, PR is welcome.

#!/bin/sh

PB_PATH="./lib/protobuf/"
PB_IN='pulsar_api.proto'
PB_OUT_F='pulsar_api.pb.rb'

mkdir -p ${PB_PATH}

wget -O ${PB_PATH}${PB_IN} https://raw.githubusercontent.com/apache/pulsar/master/pulsar-common/src/main/proto/PulsarApi.proto

# protoc -I ${PULSAR_GIT}/pulsar-common/src/main/proto/ --ruby_out ${PB_PATH} PulsarApi.proto
protoc -I ${PB_PATH} --ruby_out ${PB_PATH} ${PB_IN}
mv ${PB_PATH}pulsar_api_pb.rb ${PB_PATH}${PB_OUT_F}

# fix pulsar.proto.ProtocolVersion error: invalid name `v0' for constant
if [ $(uname) = 'Darwin' ]
then
    suffix='.pbbak'
fi

for i in $(seq 0 15)
do
    sed -i ${suffix} "s;value :v$i, $i;value :V$i, $i;g" ${PB_PATH}${PB_OUT_F}
done

rm -f ${PB_PATH}${PB_OUT_F}.pbbak

protoc -I ${PULSAR_GIT}/pulsar-common/src/main/proto/ --ruby_out ${PB_PATH} PulsarMarkers.proto
mv ${PB_PATH}PulsarMarkers_pb.rb ${PB_PATH}pulsar_markers.pb.rb

Dependency

When macOS user install google-protobuf, there maybe a suffix with universal-darwin save to Gemfile.lock. Please use google-protobuf without universal-darwin suffix. See issuse #6 for detail. Thanks for wppurking's report!

Features

  • Connection
    • Establishment
    • TLS connection
    • Authentication
  • Producer
  • Consumer
    • Flow control
    • Ack
    • Message Redelivery
    • Listen
    • Partitioned topics
    • Topic with regexp (in same namespace)
    • Topic compaction
    • Reader
    • Dead Letter Topic
    • Key Shared
  • Keep alive
    • handle ping command
    • send ping command
  • Service discovery
    • Topic lookup
  • Log Optimization
  • Connection pool
  • Unit Test
  • Thread safe
  • Schema
    • Get
    • Create
  • Admin API
    • Create Namespace
    • List namespaces in current tenant
    • Destroy Namespace
    • List Namespace Topics
    • Create Topic
    • Delete Topic
    • Peek Messages

WIP

Catch up Pulsar client feature matrix, current working on:

  • Dead Letter Topic