2

I am trying to perform inter-service communication between microservices. I followed the documentation and it was successful. Then, I tried to establish the same with echo framework. But that gives me an invalid memory address when trying to call the gRPC registered method.

 rpc error: code = Unavailable desc = connection closedpanic: 
runtime error: invalid memory address or nil pointer dereference 
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7eacad]

Server config:

    e := echo.New()
    e.Use(middleware.Logger())
    e.Use(middleware.Recover())
    e.Logger.Fatal(e.Start(":1323"))

    s := grpc.NewServer()
    hellopb.RegisterHelloServiceServer(s, NewServer())

    e.GET("/", func(c echo.Context) error {
        return c.JSON(http.StatusOK, echo.Map{"status": "success"})
    })
    s.Serve(e.Listener)

Client panics:

    resp, err := client.Hello(context.Background(), request)
    if err != nil {
        fmt.Printf("%+v", err)
    }

Hello is the function registered with gRPC.

RisingGeek
  • 83
  • 1
  • 9

0 Answers0