Skip to content

Simple example of two python services interacting with each other using consul dns interface for name resolving

Notifications You must be signed in to change notification settings

almaslennikov/consul-grpc-example

Repository files navigation

Summary

This is an example of two python microservices communicating with each other via gRPC using Consul as service registry.

Features

  • Service registration
  • gRPC health checking
  • HTTP or DNS service names resolution

Prerequisites

Setup

  1. Compile protobuf services definitions: python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. todolist.proto
  2. Run Consul binary: consul agent -dev -enable-script-checks -config-dir=./consul.d
  3. Run calculator service: python todolist_service.py
  4. Run calculator client: python web_server.py [--resolver {dns,http,grpc-dns}]

Usage

  • Access http://localhost:50052 from your browser and have fun!
  • Monitor services from Consul UI running athttp://localhost:8500

About

Simple example of two python services interacting with each other using consul dns interface for name resolving

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published