Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 1.02 KB

README.md

File metadata and controls

36 lines (31 loc) · 1.02 KB

pulsar-admin-go

This project is a Go client library for the Apache Pulsar Admin API.

Requirements

  • Go 1.18+

usage

package main

import (
	"fmt"
	"github.com/protocol-laboratory/pulsar-admin-go/padmin"
)

func main() {
	admin, err := padmin.NewDefaultPulsarAdmin()
	if err != nil {
		panic(err)
	}
	// get namespace topic list
	topics, err := admin.PersistentTopics.ListNamespaceTopics("tenant", "namespace")
	if err != nil {
		panic(err)
	}
	fmt.Println(topics)
}

how to set up the pulsar broker in unit-tests

The testcases will automatically start a pulsar broker in the background using testcontainers.
Also by detect if pulsar broker is already running, the testcases will use the existing broker. That means you can use the already exists local pulsar broker for the testcases.
You can start a pulsar broker using commands below:

docker run -it --rm -p 6650:6650 -p 8080:8080 apachepulsar/pulsar:latest /pulsar/bin/pulsar-daemon start standalone --no-functions-worker --no-stream-storage