pulsar-pubsub

command module
v0.0.0-...-2114e87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 10 Imported by: 0

README

Pulsar Pubsub

This recipe implements an event-driven application using pubsub pattern with Apache Pulsar, a high-performance event streaming platform.

Overview

This sample code is based on the original Kafka recipe. The program runs the processors for sending and receiving Kafka messages as goroutines.

Pulsar Setup

  1. Run Apache Pulsar. Note this will run Pulsar-Manager - see next section for details. It can take 10-25 seconds for pulsar to start.

    $ docker-compose up
    
  2. Run the go program.

    $ go run main.go
    
  3. Terminate the programs.

    $ # Press CTRL-C to terminate the go program
    $ # Next shutdown pulsar
    $ docker-compose down
    
  4. Alternatively, you can run everything with just one command.

    $ make
    $ docker-compose down    # Run this to remove the containers
    

Pulsar Manager Setup

Pulsar Manager is a visual dashboard, a nice-to-have to quick inspect what Pulsar is doing (it's not required to get the code running). There's a bit of extra setup that you need to do before you can start using the tool.

  1. Run docker-compose.

    $ docker-compose up
    
  2. Generate an admin account to access the tool.

    $ ./gen-admin.sh
    
  3. Launch the web browser and go to http://localhost:9527. Use username admin and password password to log into the tool.

  4. Add an environment by connecting to the Pulsar host. Use the following parameters when creating a new environment.

    Config Name Config Value
    Environment Name standalone
    Service URL http://pulsar:8080/

Reference and Credits

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL