In this recipe, we will create another microservice using go-micro, which is a replica of the first-greeting-service.go except for the logger message printed on the console that demonstrates the concept of client-side load balancing between the two different instances of a service with the same name.
Creating your second microservice
How to do it...
- Create second-greeting-service.go inside the services directory by executing the command $ cd services && touch second-greeting-service.go.
- Copy the following content to second-greeting-service.go:
package main
import
(
"context"
"log"
"time"
hello "../proto"
"github.com/micro/go-micro"
)
type Say struct{}
func (s *Say...