docker build . -t gcppubsub:latest
docker run -p 8085:8085 gcppubsub:latest
- test with curl:
http://localhost:8085
or0.0.0.0:8085
- Host and ports can be passed as part of building the image
-
Projects are created "on the fly" when creating topics
-
Create a topic:
PUT http://localhost:8085/v1/projects/test/topics/cats
wherecats
is a new topic name andtest
is the project -
Get project topics
GET http://localhost:8085/v1/projects/test/topics
-
Subscribe to topic:
PUT http://localhost:8085/v1/projects/test/subscriptions/test-sub
wheretest-sub
is the subscription name- Payload:
{"topic": "projects/test/topics/cats"}
- Payload:
-
Publish message to topic:
POST http://localhost:8085/v1/projects/test/topics/cats:publish
- Payload:
{"messages": [{"data": "cats rule"}]}
- Payload:
-
Pull messages from topic:
POST localhost:8085/v1/projects/test/subscriptions/test-sub:pull
- Payload:
{"max_messages": 1}
- Payload:
-
Curl samples: https://github.com/robertsicoie/gcp-pubsub-samples
docker image prune --filter label=stage=builder
- Do we need configurable hosts/ports?