- docker installed
- docker-compose installed
- Change PROJECT_ID_EXAMPLE variable with your project ID on
docker-compose.yml
file. - Run emulator.
$ docker-compose up
$ ./publisher create [TOPIC_ID]
$ ./subscriber create [TOPIC_ID] [SUBSCRIPTION_ID]
$ ./subscriber create-push [TOPIC_ID] [SUBSCRIPTION_ID] [ENDPOINT]
$ 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
$ 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 -h
$ ./subscriber -h