gcloud_alpha_emulators_pubsub (1)
NAME
- gcloud alpha emulators pubsub - manage your local pubsub emulator
SYNOPSIS
-
gcloud alpha emulators pubsub COMMAND [--data-dir=DATA_DIR] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) This set of commands allows you to start and use a local Pub/Sub
To stop the emulator, press Ctrl+C.
For a more comprehensive overview of Pub/Sub, see cloud.google.com/pubsub/docs/overview For Pub/Sub emulator specific documentation, see cloud.google.com/pubsub/docs/emulator
FLAGS
-
- --data-dir=DATA_DIR
-
The directory to be used to store/retrieve data/config for an emulator run. The
default value is <USER_CONFIG_DIR>/emulators/pubsub. The value of
USER_CONFIG_DIR can be found by running:
- $ gcloud info --format='get(config.paths.global_config_dir)'
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
COMMANDS
COMMAND is one of the following:
-
- env-init
-
(ALPHA) Print the commands required to export pubsub emulator's env
variables.
- start
-
(ALPHA) Start a local pubsub emulator.
EXAMPLES
To start a local pubsub emulator with the default directory for configuration data, run:
- $ gcloud alpha emulators pubsub start
After starting the emulator, if your application and emulator run on the same machine, set environment variables automatically by running:
- $ gcloud alpha emulators pubsub env-init
If you're running your emulator on a different machine, run the above command and use its resulting output to set the environment variables on the machine that runs your application. This might look like:
- $ export PUBSUB_EMULATOR_HOST=localhost:8538 $ export PUBSUB_PROJECT_ID=my-project-id
Your emulator is now ready for use.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support This variant is also available:
- $ gcloud beta emulators pubsub