Topic 1 Question 275
You have a web application that publishes messages to Pub/Sub. You plan to build new versions of the application locally and need to quickly test Pub/Sub integration for each new build. How should you configure local testing?
In the Google Cloud console, navigate to the API Library, and enable the Pub/Sub API. When developing locally configure your application to call pubsub.googleapis.com.
Install the Pub/Sub emulator using gcloud, and start the emulator with a valid Google Project ID. When developing locally, configure your applicat.cn to use the local emulator by exporting the PUBSUB_EMULATOR_HOST variable.
Run the gcloud config set api_endpoint_overrides/pubsub https://pubsubemulator.googleapis.com.com/ command to change the Pub/Sub endpoint prior to starting the application.
Install Cloud Code on the integrated development environment (IDE). Navigate to Cloud APIs, and enable Pub/Sub against a valid Google Project IWhen developing locally, configure your application to call pubsub.googleapis.com.
ユーザの投票
コメント(2)
- 正解だと思う選択肢: B
For local testing of Pub/Sub integration, the most suitable option is B. You’d install the Pub/Sub emulator via gcloud, initiate it with a valid Google Project ID, and configure your application to utilize the local emulator by setting the PUBSUB_EMULATOR_HOST variable. This method replicates the Pub/Sub environment locally for efficient testing.
👍 3MFay2023/12/03 - 正解だと思う選択肢: B
For local testing of Pub/Sub integration in a web application, installing and using the Pub/Sub emulator is the most efficient approach. The emulator can be installed via gcloud and started with a valid Google Project ID. Configuring your application to use the emulator locally is done by setting the PUBSUB_EMULATOR_HOST environment variable.
For more details on setting up and using the Pub/Sub emulator, visit: Google Cloud Documentation: https://cloud.google.com/pubsub/docs/emulator
👍 2plutonians1232023/12/13
シャッフルモード