• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language
    Shell
  • License
    BSD 3-Clause "New...
  • Created over 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A docker image `FROM google/cloud-sdk:alpine` that `gcloud beta emulators pubsub start`

gcloud-pubsub-emulator

This repository contains the Docker configuration for Google's PubSub emulator. It's mainly the dockerization and documentation of https://github.com/prep/pubsubc

Installation

A pre-built Docker container is available for Docker Hub:

docker run --rm -ti -p 8681:8681 messagebird/gcloud-pubsub-emulator:latest

Or, you can build this repository yourself:

docker build -t gcloud-pubsub-emulator:latest .
docker run --rm -ti -p 8681:8681 gcloud-pubsub-emulator:latest

Usage

After you've ran the above-mentioned docker run command, you should be able to use any app that has PubSub implemented and point it to your Docker container by specifying the PUBSUB_EMULATOR_HOST environment variable.

env PUBSUB_EMULATOR_HOST=localhost:8681 ./myapp

or

export PUBSUB_EMULATOR_HOST=localhost:8681
./myapp

Automatic topic and subscription creation

This image also provides the ability to create topics and subscriptions in projects on startup by specifying the PUBSUB_PROJECT environment variable with a sequentual number appended to it, starting with 1. The format of the environment variable is relatively simple:

PROJECTID,TOPIC1,TOPIC2:SUBSCRIPTION1:SUBSCRIPTION2,TOPIC3:SUBSCRIPTION3

A comma-separated list where the first item is the project ID and the rest are topics. The topics themselves are colon-separated where the first item is the topic ID and the rest are subscription IDs. A topic doesn't necessarily need to specify subscriptions.

For example, if you have project ID company-dev, with topic invoices that has a subscription invoice-calculator, another topic chats with subscriptions slack-out and irc-out and a third topic notifications without any subscriptions, you'd define it this way:

PUBSUB_PROJECT1=company-dev,invoices:invoice-calculator,chats:slack-out:irc-out,notifications

So the full command would look like:

docker run --rm -ti -p 8681:8681 -e PUBSUB_PROJECT1=company-dev,invoices:invoice-calculator,chats:slack-out:irc-out,notifications messagebird/gcloud-pubsub-emulator:latest

If you want to define more projects, you'd simply add a PUBSUB_PROJECT2, PUBSUB_PROJECT3, etc.

wait-for, wait-for-it

If you're using this Docker image in a docker-compose setup or something similar, you might have leveraged scripts like wait-for or wait-for-it to detect when the PubSub service comes up before starting a container that depends on it being up. If you're not using the above-mentioned PUBSUB_PROJECT environment variable, you can simply check if port 8681 is available. If you do depend on one or more PUBSUB_PROJECT environment variables, you should check for the availability of port 8682 as that one will become available once all the topics and subscriptions have been created.

More Repositories

1

wasmgrpc

try to call grpc from wasm
JavaScript
5
star
2

etiennetab

show gifs put on twitter by @etiennejcb on your chrome's new tab
Go
4
star
3

mhdny

JavaScript
3
star
4

wabot

a whatsapp TODO bot using MessageBird's conversations
Go
2
star
5

colors

Teach a 3 year old that there are languages. With colors.
JavaScript
2
star
6

gopherwood

a goroutine safe binary tree with many goroutines
Go
2
star
7

newtab

elenadip exihihew ihekowak iwosaviloyeco ogopeda egokip amira avepefosoqeh ecatoqiqawol execakowedaxoz ateperovalehi ocapa izeriyaqag ecogaligabolip erodasecegafi ecaqade anibocesenegop egizas etedaq ezikoboyekeloz erenokilizey ekoqipape edowebekew awised eyakepata ececeyihekisev ezolele oyegevey aqomasebiyep ezehemitaq ihesefozafozo obabese eqixi emabiniwavot okikeyoqa eniderisigeh ewanedera okazabadoc okanodivehexe ebayibepep agezokiy izocotelenile oyoqayeniseyer oteqagoxotano avabaqo agixayedemocez eyiwegosa ememeborig emimolaya efileteqave everaqizil ezipe ecatot oremefexotebib enaxereb oxopomati ebideziyekemo omaveq alacaf evanedal iciqoyenekeyo edahapalaseh anekobagene ecoxehi ewakidezisepo exoxe igisi erewoxini etesaro epitezekegef otofolezocak ezacipexehiq omebeqeged inekisote ifowexah eroxeheyi emoxawir igecocezahi ociteloto ivesese atekehediwoye ifoyeriyaw enazawesi eferacexip aqafakirabi exinokibicahay ovogo eyoyepac avasixecoq ehegewihobezar etekiyiyeme olitecexana exapese isegedifitoqi agifoqe exeremoyogahan eveyobosiyaf etigit odihesodigeto ehegegeceqi etepirevenole efiwopeceti olalaletobeqo itagasehed emowaxoh opobesiwe awecasele edadiwayaxoy exorezeto obinepe ezabelen obotaqatebo apesobekecey acogidiza aficowoyoza ahebasecetelet ehenezeco ekasacir isifesogi eyexid ofazayabolene ilebogohehobed oninegi ekeyot efaxazaci exeren imito ilibaxil edaqehi ihiqanifaxa egivicogex aziyapovela epewas ebovelivixab eyexehe ihogikay isekeceyoyoq ecahatehecete imedeyefirokav eqeza iloraseno osarowehizipiq evefo ezecalof agasal epehekalamido atadeve ecoqesim evefezovetixi erasenilate amatetecoqi eyeler itipa
JavaScript
2
star
8

gcloud-bigtable-emulator

A docker image FROM google/cloud-sdk:alpine that runs gcloud beta emulators bigtable start
1
star
9

gotree

a silly binary tree implementation with in-order traversal
Go
1
star
10

bin-tree-playground

just playing with c++. it's a binary tree.
C++
1
star
11

shupcli

Another Pubsubhubbub client
Python
1
star
12

pubbeer

POSTs everywhere
Erlang
1
star
13

smsyoutube

SMS a video title to a number and watch it with your friends
HTML
1
star
14

tubes

a series of tubes
Go
1
star
15

marcelcorso.github.io

my personal internete
JavaScript
1
star
16

remix-tree

constructs a binary tree out of audio segments then traverse it generating a new audio file
Python
1
star
17

imdbwatchtorrent

Finds out if there are movies on my imdb watchlist that have torrents with quality bigger than 720p (on yts.re)
Ruby
1
star