This is a simple app written in python that has two scripts:
-
publisher.py: that is in charge to take a message from the standard input and published to the cloud
-
subscriber.py: listen endlessly for messages from the publisher
This app use Google Cloud publisher-subscriber tool to save the messages in the cloud and let all the subscriber read this messages not matter when they start to listen
-
Run the file configure.sh with the next commands
source ./configure.sh
andsource ./set_env.sh
. -
Log in you google cloud account and create a topic with the name 'low-level-lab'.
-
Inside that topic create a subscriber and call it 'subscriber'.
-
Create a key to access to your project from python. This is done inside accounts services.
-
Put the key in the root of the app and change the name to 'key.json'.
-
In the two scripts change the value of the project variable to the name of your project in your google cloud console
-
Test the scripts.
Daniel Rodriguez