Skip to content

Spike to investigate how to locally test GCP PubSub integration with GCP Cloud Functions

Notifications You must be signed in to change notification settings

monch1962/pubsub-emulator-spike

Repository files navigation

pubsub-emulator-spike

Spike to investigate how to locally test GCP PubSub integration with GCP Cloud Functions

Setup

$ python3 -m venv spike $ source spike/bin/activate $ pip install -f requirements.txt

to create a clean Python virtual environment and install dependencies

Then

$ ./start-pubsub-emulator

to pull & run a PubSub emulation environment inside Docker. This will be exposed on TCP/8085

Run

$ PUBSUB_EMULATOR_HOST=localhost:8085 ./pubsub_publish.py

will load some sample messages into the PubSub emulator.

Running

$ PUBSUB_EMULATOR_HOST=localhost:8085 ./pubsub_subscribe.py

in a separate shell will let you view those messages.

Next steps

Use https://github.com/GoogleCloudPlatform/functions-framework-python#quickstart-pubsub-emulator to set up a Python Cloud Function to consume the messages that are in the PubSub emulator

About

Spike to investigate how to locally test GCP PubSub integration with GCP Cloud Functions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published