pubsub/

directory
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT

README

Dapr PubSub Example with go-sdk

This folder contains two go file that use the Go SDK to invoke the Dapr Pub/Sub API.

Diagram

Step

Prepare
  • Dapr installed
Run Subscriber Server
dapr run --app-id sub \
         --app-protocol http \
         --app-port 8080 \
         --dapr-http-port 3500 \
         --log-level debug \
         --components-path ../config \
         go run sub/sub.go
Run Publisher
export DAPR_PUBSUB_NAME=messages

dapr run --app-id pub \
         --log-level debug \
         --components-path ../config \
         go run pub/pub.go

Result

== APP == 2020/08/23 13:21:58 event - PubsubName: messages, Topic: demo, ID: 11acaa82-23c4-4244-8969-7360dae52e5d, Data: ping

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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