All Projects → jczuchnowski → zio-pulsar

jczuchnowski / zio-pulsar

Licence: BSD-2-Clause License
Apache Pulsar client for Scala with ZIO and ZIO Streams integration.

Programming Languages

scala
5932 projects
shell
77523 projects

Projects that are alternatives of or similar to zio-pulsar

tamer
Standalone alternatives to Kafka Connect Connectors
Stars: ✭ 42 (+162.5%)
Mutual labels:  zio, zio-streams
podpodge
Convert YouTube playlists to audio-only RSS feeds for podcast apps to consume.
Stars: ✭ 32 (+100%)
Mutual labels:  zio
stem
Event sourcing framework based on ZIO and pluggable runtime (currently working with Akka cluster)
Stars: ✭ 22 (+37.5%)
Mutual labels:  zio
zio-redis
A ZIO-based redis client
Stars: ✭ 76 (+375%)
Mutual labels:  zio
etlflow
EtlFlow is an ecosystem of functional libraries in Scala based on ZIO for writing various different tasks, jobs on GCP and AWS.
Stars: ✭ 38 (+137.5%)
Mutual labels:  zio
zorechka-bot
Github bot for keeping your Bazel dependencies up-to-date and clean
Stars: ✭ 25 (+56.25%)
Mutual labels:  zio
code-examples-manager
Software tool to manage your notes and code examples, to publish them as gists or snippets
Stars: ✭ 26 (+62.5%)
Mutual labels:  zio
pulsar-tracing
Tracing instrumentation for Apache Pulsar clients.
Stars: ✭ 13 (-18.75%)
Mutual labels:  apache-pulsar
zio-entity
Zio-Entity, a distributed, high performance, functional event sourcing library
Stars: ✭ 68 (+325%)
Mutual labels:  zio
SharpPulsar
One million topics client for Apache Pulsar - that is the goal!
Stars: ✭ 23 (+43.75%)
Mutual labels:  apache-pulsar
zio-http4s-example
For anyone who's struggling to put an http4s server together with ZIO
Stars: ✭ 19 (+18.75%)
Mutual labels:  zio
supernova
🌌 Apache Pulsar client for Haskell
Stars: ✭ 35 (+118.75%)
Mutual labels:  apache-pulsar
pulsar-helm-chart
Helm Chart for an Apache Pulsar Cluster
Stars: ✭ 31 (+93.75%)
Mutual labels:  apache-pulsar
tgip-cn
TGIP-CN (Thank God Its Pulsar) is a weekly live video streaming about Apache Pulsar in Chinese.
Stars: ✭ 96 (+500%)
Mutual labels:  apache-pulsar
terraform-provider-pulsar
Terraform provider for managing Apache Pulsar entities
Stars: ✭ 21 (+31.25%)
Mutual labels:  apache-pulsar
zio-telemetry
ZIO-powered OpenTelemetry library
Stars: ✭ 93 (+481.25%)
Mutual labels:  zio
pulsarctl
a CLI for Apache Pulsar written in Go
Stars: ✭ 106 (+562.5%)
Mutual labels:  apache-pulsar
conduktor-coding-challenge
Want to work with us? Here is a mini-coding challenge you can try :)
Stars: ✭ 41 (+156.25%)
Mutual labels:  zio
zio-event-sourcing
Purely functional concurent and scalable persistance layer implementing CQRS
Stars: ✭ 34 (+112.5%)
Mutual labels:  zio
event-driven-messenger
No description or website provided.
Stars: ✭ 43 (+168.75%)
Mutual labels:  zio

ZIO Pulsar

CI Release Snapshot
CI Release Artifacts Snapshot Artifacts

Purely functional Scala wrapper over the official Pulsar client.

  • Type-safe (utilizes Scala type system to reduce runtime exceptions present in the official Java client)
  • Streaming-enabled (naturally integrates with ZIO Streams)
  • ZIO integrated (uses common ZIO primitives like ZIO effect and ZManaged to reduce the boilerplate and increase expressiveness)

Compatibility

ZIO Pulsar is a Scala 3 library, so it's compatible with Scala 3 applications as well as Scala 2.13.6+ (see forward compatibility for more information.

Getting started

Add the following dependency to your build.sbt file:

Scala 3

libraryDependencies += "com.github.jczuchnowski" %% "zio-pulsar" % zioPulsarVersion

Scala 2.13.6+ (sbt 1.5.x)

libraryDependencies += 
  ("com.github.jczuchnowski" %% "zio-pulsar" % zioPulsarVersion).cross(CrossVersion.for2_13Use3)

ZIO Pulsar also needs ZIO and ZIO Streams to be provided:

libraryDependencies ++= Seq(
  "dev.zio" %% "zio"         % zioVersion,
  "dev.zio" %% "zio-streams" % zioVersion
)

Simple example of consumer and producer:

import org.apache.pulsar.client.api.{ PulsarClientException, Schema }
import zio._
import zio.pulsar._

object Main extends App:

  val pulsarClient = PulsarClient.live("localhost", 6650)

  val topic = "my-topic"

  val app: ZManaged[PulsarClient, PulsarClientException, Unit] =
    for
      builder  <- ConsumerBuilder.make(Schema.STRING).toManaged_
      consumer <- builder
                    .topic(topic)
                    .subscription(
                      Subscription(
                        "my-subscription", 
                        SubscriptionType.Shared))
                    .build
      producer <- Producer.make(topic, Schema.STRING)
      _        <- producer.send("Hello!").toManaged_
      m        <- consumer.receive.toManaged_
    yield ()
    
  def run(args: List[String]): URIO[ZEnv, ExitCode] =
    app.provideCustomLayer(pulsarClient).useNow.exitCode

Running examples locally

To try the examples from the examples subproject you'll need a Pulsar instance running locally. You can set one up using docker:

docker run -it \
  -p 6650:6650 \
  -p 8080:8080 \
  --mount source=pulsardata,target=/pulsar/data \
  --mount source=pulsarconf,target=/pulsar/conf \
  --network pulsar \
  apachepulsar/pulsar:2.7.0 \
  bin/pulsar standalone
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].