micro
develop
develop
  • Micro Starter Kit
  • Features
  • Getting Started
    • Why
    • Prerequisites
    • Installation
    • Makefile
  • Concepts
    • Introduction
    • Configuration
    • State
    • Select
  • Advanced
    • Dependency Injection
    • Logging
    • Error Handling
    • Life-cycle
    • Git Flow
    • Git Ops
    • mTLS
    • Release
    • Release Process
    • Pub Sub
    • Troubleshooting
  • Modules
    • Commands
      • Demo
    • Services
      • Account
      • Emailer
      • Greeter
      • Recorder
  • DevOps
    • Docker
    • KinD
    • Istio
  • Testing
    • Intro
    • Mock
    • Bloom RPC
  • Recipes
    • Authentication
    • Caching
    • Health Checks
    • Performance Testing
    • Dynamic Plugins
    • Immutability Helpers
    • Style Guide
    • Unit Testing
  • Community
    • Resources
    • Contributors
    • Contributing
  • Change Log
  • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Advanced

Pub Sub

export GOOGLEPUBSUB_PROJECT_ID=my-project-id
gcloud beta emulators pubsub start --project=$GOOGLEPUBSUB_PROJECT_ID --host-port=localhost:8085
# Create topic `mkit.service.emailer` (optional)
# Note: Second time when you run below service, it will automatically create topic
gcloud pubsub topics create mkit.service.emailer

Run service

export GOOGLEPUBSUB_PROJECT_ID=my-project-id
# PUBSUB_EMULATOR_HOST for Dev
$(gcloud beta emulators pubsub env-init)
export PUBSUB_EMULATOR_HOST=localhost:8085

# set GOOGLE_APPLICATION_CREDENTIALS for Prod
# export GOOGLE_APPLICATION_CREDENTIALS=~/path/your_project_credentials.json
export MICRO_BROKER=googlepubsub
make run-emailer ARGS="--server_address=localhost:8080"
PreviousRelease ProcessNextTroubleshooting

Last updated 5 years ago

Was this helpful?