marcelcorso / gcloud-pubsub-emulator

A docker image `FROM google/cloud-sdk:alpine` that `gcloud beta emulators pubsub start`
BSD 3-Clause "New" or "Revised" License
161 stars 57 forks source link

Clarify port use when using PUBSUB_PROJECT env vars #11

Open matthewadams opened 4 years ago

matthewadams commented 4 years ago

The following sentences are confusing to me:

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.

The first sentence is pretty clear. Use 8681 if you're not using PUBSUB_PROJECT env vars, but the second sentence seems to imply something.

Is that to say that, for each PUBSUB_PROJECTN, where N is a one-based index, that a client should connect to port 8681 + N, or, no matter how many PUBSUB_PROJECTN env vars there are, you always connect to port 8682?

Why would I ever connect to any port other than 8681? Please clarify. :)

veleek commented 2 years ago

You should always connect to 8681. After the topics and subscriptions are created, the service starts listening on port 8682 ONLY to indicate that it's done. The listener on port 8682 doesn't do anything and will drop any requests sent to it. You should continue connecting to 8681 to access everything.