Skip to content

abtin/gopubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A quick sample code to create a google pubsub topic and subscription and publish/receive form/to it.

Setup:

  • Create a GCP project
  • From the API and services add pubsub
  • Create a service account and give it pubsub role, save the credentials

Execution:

  • To create topic and subscription:
    ./gopubsub -create -projectId=<projectId> -topic=<topic> -subscription=<subscription>
    
  • To receive messages from a topic/subscription:
    ./gopubsub -projectId=<projectId> -topic=<topic> -subscription=<subscription> -publisher=false
    
  • To publish messages, one word at a time, on a topic/subscription:
    ./gopubsub -projectId=<projectId> -topic=<topic> -subscription=<subscription> -publisher
    

About

A sample pubsub code in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages