All Projects → apache → Pulsar Client Go

apache / Pulsar Client Go

Licence: other
Apache Pulsar Go Client Library

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Pulsar Client Go

Pulsar Dotpulsar
The official .NET client library for Apache Pulsar
Stars: ✭ 101 (-59.76%)
Mutual labels:  messaging, pubsub, streaming
Pulsar
Apache Pulsar - distributed pub-sub messaging system
Stars: ✭ 10,118 (+3931.08%)
Mutual labels:  messaging, pubsub, streaming
Centrifugo
Scalable real-time messaging server in a language-agnostic way. Set up once and forever.
Stars: ✭ 5,649 (+2150.6%)
Mutual labels:  messaging, streaming, pubsub
pulsar-helm-chart
Official Apache Pulsar Helm Chart
Stars: ✭ 122 (-51.39%)
Mutual labels:  streaming, messaging, pubsub
Liftbridge
Lightweight, fault-tolerant message streams.
Stars: ✭ 2,175 (+766.53%)
Mutual labels:  messaging, pubsub, streaming
liftbridge-api
Protobuf definitions for the Liftbridge gRPC API. https://github.com/liftbridge-io/liftbridge
Stars: ✭ 15 (-94.02%)
Mutual labels:  streaming, messaging, pubsub
pulsar-adapters
Apache Pulsar Adapters
Stars: ✭ 18 (-92.83%)
Mutual labels:  streaming, messaging, pubsub
pulsar-client-node
Apache Pulsar NodeJS Client
Stars: ✭ 88 (-64.94%)
Mutual labels:  streaming, messaging, pubsub
Pulsar Manager
Apache Pulsar Manager
Stars: ✭ 247 (-1.59%)
Mutual labels:  messaging, pubsub, streaming
Hivemq Community Edition
HiveMQ CE is a Java-based open source MQTT broker that fully supports MQTT 3.x and MQTT 5. It is the foundation of the HiveMQ Enterprise Connectivity and Messaging Platform
Stars: ✭ 562 (+123.9%)
Mutual labels:  messaging, pubsub
Hermes
Fast and reliable message broker built on top of Kafka.
Stars: ✭ 665 (+164.94%)
Mutual labels:  messaging, pubsub
Nats.rb
Ruby client for NATS, the cloud native messaging system.
Stars: ✭ 850 (+238.65%)
Mutual labels:  messaging, pubsub
Ejabberd
Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
Stars: ✭ 5,077 (+1922.71%)
Mutual labels:  messaging, pubsub
Spring Streaming
SPA on Spring Boot 1.x, WebSockets and React, gradle, nodejs, spring-boot, gradle multi project, spring-mvc, spring-data, gradle dependency update plugin, react-router
Stars: ✭ 6 (-97.61%)
Mutual labels:  messaging, streaming
Jocko
Kafka implemented in Golang with built-in coordination (No ZK dep, single binary install, Cloud Native)
Stars: ✭ 4,445 (+1670.92%)
Mutual labels:  messaging, streaming
Emqx
An Open-Source, Cloud-Native, Distributed MQTT Message Broker for IoT.
Stars: ✭ 8,951 (+3466.14%)
Mutual labels:  messaging, pubsub
Centrifuge
Real-time messaging library for Go with scalability in mind
Stars: ✭ 446 (+77.69%)
Mutual labels:  messaging, pubsub
Libzmq
ZeroMQ core engine in C++, implements ZMTP/3.1
Stars: ✭ 7,418 (+2855.38%)
Mutual labels:  messaging, pubsub
Beaver
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
Stars: ✭ 1,056 (+320.72%)
Mutual labels:  messaging, pubsub
Garagemq
AMQP message broker implemented with golang
Stars: ✭ 153 (-39.04%)
Mutual labels:  messaging, pubsub

GoDoc Go Report Card Language LICENSE

Apache Pulsar Go Client Library

A Go client library for the Apache Pulsar project.

Goal

This projects is developing a pure-Go client library for Pulsar that does not depend on the C++ Pulsar library.

Once feature parity and stability are reached, this will supersede the current CGo based library.

Requirements

  • Go 1.11+

Status

Check the Projects page at https://github.com/apache/pulsar-client-go/projects for tracking the status and the progress.

Usage

Import the client library:

import "github.com/apache/pulsar-client-go/pulsar"

Create a Producer:

client, err := pulsar.NewClient(pulsar.ClientOptions{
    URL: "pulsar://localhost:6650",
})

defer client.Close()

producer, err := client.CreateProducer(pulsar.ProducerOptions{
	Topic: "my-topic",
})

_, err = producer.Send(context.Background(), &pulsar.ProducerMessage{
	Payload: []byte("hello"),
})

defer producer.Close()

if err != nil {
    fmt.Println("Failed to publish message", err)
}
fmt.Println("Published message")

Create a Consumer:

client, err := pulsar.NewClient(pulsar.ClientOptions{
    URL: "pulsar://localhost:6650",
})

defer client.Close()

consumer, err := client.Subscribe(pulsar.ConsumerOptions{
        Topic:            "my-topic",
        SubscriptionName: "my-sub",
        Type:             pulsar.Shared,
    })

defer consumer.Close()

msg, err := consumer.Receive(context.Background())
    if err != nil {
        log.Fatal(err)
    }

fmt.Printf("Received message msgId: %#v -- content: '%s'\n",
            msg.ID(), string(msg.Payload()))

Create a Reader:

client, err := pulsar.NewClient(pulsar.ClientOptions{URL: "pulsar://localhost:6650"})
if err != nil {
	log.Fatal(err)
}

defer client.Close()

reader, err := client.CreateReader(pulsar.ReaderOptions{
	Topic:          "topic-1",
	StartMessageID: pulsar.EarliestMessageID(),
})
if err != nil {
	log.Fatal(err)
}
defer reader.Close()

for reader.HasNext() {
	msg, err := reader.Next(context.Background())
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Received message msgId: %#v -- content: '%s'\n",
		msg.ID(), string(msg.Payload()))
}

Contributing

Contributions are welcomed and greatly appreciated. See CONTRIBUTING.md for details on submitting patches and the contribution workflow.

Contact

Mailing lists
Name Scope
[email protected] User-related discussions Subscribe Unsubscribe Archives
[email protected] Development-related discussions Subscribe Unsubscribe Archives
Slack

Pulsar slack channel #dev-go at https://apache-pulsar.slack.com/

You can self-register at https://apache-pulsar.herokuapp.com/

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

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].