Skip to content

antipopp/pubsub-emulator-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pubsub-emulator-toolkit

Tool to better test Google Pub/Sub calls and messages while using the gcloud emulator locally

Usage

  • Start the emulator (google's docs)
    gcloud beta emulators pubsub start --project=YOUR_PUBSUB_PROJECTID
  • Set the environment variable with the Pub/Sub emulator address
    export PUBSUB_EMULATOR_HOST=localhost:8085
  • Run the toolkit
    go run main.go YOUR_PUBSUB_PROJECTID
    

Available commands

  • newtopic <topic-id> creates a new topic with name 'topic-id'
  • publish <topic-id> <data> <attributes> publishes on topic-id the message data with attributes attributes. This is mostly hardcoded, but you can change the message easily in the code itself
  • showtopics lists all the topics in the active project
  • showsubs lists all the subscriptions in the active project
  • exit gracefully exits the program, even if CTRL + C has no side effects.

About

Tool to better test Google Pub/Sub calls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages