Lab #5: Microservices with Consul

Labs Completion Status
Lab #1: Microservice Basics
Lab #2: Hazelcast Basics
Lab #3: Microservices & Hazelcast
Lab #4: Microservices & Message Queue
Lab #5: Microservices with Consul

General Architecture

Requirements

  1. Python vesrion: Python >= 3.7
  2. Install Kafka. Link.
  3. Install Hazelcast & Management Center.
brew tap hazelcast/hz 
brew install hazelcast
brew install hazelcast-management-center
  1. Install Consul.
brew install consul

Run Project

  1. Start Kafka Zookeeper & Broker.
# Start Zookeeper. Running on 127.0.0.1:2181
zookeeper-server-start.sh config/zookeeper.properties

# Start Kafka Broker. Running on 127.0.0.1:9092
kafka-server-start.sh config/server.properties

# Create Kafka Topic if not created.
kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --topic MessageServiceTopic --create --partitions 3 --replication-factor 1
  1. Start Hazelcast (3 Instances).
# Start Hazelcast Instance. 
hz start

# Start Hazelcast Management Center. Running on localhost:8080
hz-mc start
  1. Start Consul.
# Start Consul agent. Running on localhost:8500
consul agent -dev

# Initialize values in KV storage.
sh consul_init.sh
  1. Start Facade-Service.
~/facade-service $ sh start-service.sh 8081 
  1. Start Logging-Service (3 Instances).
~/logging-service $ sh start-service.sh 8082 
~/logging-service $ sh start-service.sh 8083
~/logging-service $ sh start-service.sh 8084
  1. Start Message-Service (2 Instances).
~/message-service $ sh start-service.sh 8085
~/message-service $ sh start-service.sh 8086