Skip to content

car12o/gcloud-pubsub-emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pubsub-emulator

gcloud publisher & subscriber emulator

Requirements

Get start

  1. Change PROJECT_ID_EXAMPLE variable with your project ID on docker-compose.yml file.
  2. Run emulator.
$ docker-compose up

Usage

- Create publisher topic
$ ./publisher create [TOPIC_ID]
- Create topic subscriber/subscriber-push
$ ./subscriber create [TOPIC_ID] [SUBSCRIPTION_ID]
$ ./subscriber create-push [TOPIC_ID] [SUBSCRIPTION_ID] [ENDPOINT]
- Publishe message to the topic
$ curl -d '{"messages": [{"data": "msg_data"}]}' -H "Content-Type: application/json" -X POST 0.0.0.0:8085/v1/projects/[PUBSUB_PROJECT_ID]/topics/[TOPIC_ID]:publish
- Read subscriber messages
$ curl -d '{"returnImmediately": true, "maxMessages": 10}' -H "Content-Type: application/json" -X POST 0.0.0.0:8085/v1/projects/[PUBSUB_PROJECT_ID]/subscriptions/[SUBSCRIPTION_ID]:pull
- Publisher help
$ ./publisher -h
- Subscriber help
$ ./subscriber -h

More info

https://cloud.google.com/pubsub/docs/emulator

About

gcloud publisher & subscriber emulator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages