title: Nest grpc client is not communicating with the grpc server
body: <p>I was trying to implement a simple grpc service in my nest js project but unfortunately my client is not communicating with the server. I am sharing
  some codes below. It will be really helpful if anyone can give me some insights of whats going wrong.</p>
  <p>--------- GRPC Server -------</p>
  <p>Main.ts file looks like this.</p>
  <pre><code> async function setUpGrpc(grpcUrl){
     const grpcApp = await NestFactory.createMicroservice&lt;MicroserviceOptions&gt;(GrpcModule, {
     transport: Transport.GRPC,
     options: {
      package: 'protos.user',
      url : grpcUrl,
      protoPath: join(__dirname, '/protos/user.proto'),
      },
     });
     return grpcApp;
  }
  
  async function bootstrap() {
     const app = await NestFactory.create(AppModule);
     const configService = app.get(ConfigService);
     const port = configService.get('PORT');
  
     const grpcUrl = configService.get('GRPC_URL');
     console.log(grpcUrl);
     const grpcApp = await setUpGrpc(grpcUrl);
  
     await grpcApp.listen(()=&gt;{
       console.log(&quot;Grpc is listening&quot;)
     });
     await app.listen(port);
    }
  bootstrap();
  </code></pre>
  <p>GrpcModule</p>
  <pre><code>@Module({
    imports: [
      SequelizeDbModule,
    ],
    controllers: [GrpcUserController],
    providers: [],
  })
  export class GrpcModule {}
  </code></pre>
  <p>GrpcUserController</p>
  <pre><code>interface IUserInfo {
    userName: string;
    passWord: string;
    tenantId: string;
  }
  interface IUser {
    id: string;
    name: string;
    email: string;
    phone: string;
    tenantId: string;
  }
  
  @Controller()
  export class GrpcUserController {
    constructor() {}
  
     @GrpcMethod('UserValidationService', 'ValidateUser')
     validateUser(userInfo: IUserInfo, metaData: any) : IUser {
      console.log('Call is made');
  
      return {name:'Test',phone:'Test',email:&quot;Test@Test&quot;,tenantId:&quot;TestTenant&quot;,id:'TestId'};
    }
  }
  </code></pre>
  <p>My Proto file looks like this.</p>
  <pre><code>syntax = &quot;proto3&quot;;
  
  package protos.user;
  
  service UserValidationService {
    rpc ValidateUser (UserInfo) returns (User) {}
  }
  
  message UserInfo {
    string userName = 1;
    string passWord = 2;
    string tenantId = 3;
  }
  
  message User {
    string id = 1;
    string name = 2;
    string email = 3;
    string phone = 4;
    string tenantId = 5;
  }
  </code></pre>
  <p>------ Client --------</p>
  <p>Used the same protofile</p>
  <p>I made the client as a nest library</p>
  <pre><code>@Injectable()
  export class UserGrpcClientService implements OnModuleInit {
  
    userValidationService:IUserValidationService;
  
    @Client( {
      transport: Transport.GRPC,
      options: {
        package: 'protos.user',
        url : &quot;localhost:5000&quot;,
        protoPath: join(__dirname, '/protos/user.proto'),
      },
    })
    client : ClientGrpc
    constructor(){}
  
    onModuleInit() {
       this.userValidationService = this.client.getService&lt;IUserValidationService('UserValidationService');
      console.log(this.userValidationService);
    }
  
      validateUser(userInfo: IUserInfo) : Observable&lt;any&gt;{
  
       console.log(&quot;Inside validateUser&quot;);
       console.log(JSON.stringify(userInfo));
       return  this.userValidationService.validateUser({userName:userInfo.userName,
                                                  passWord:userInfo.passWord,
                                                  tenantId:userInfo.tenantId}); 
    }
  }   
  </code></pre>
  <p>interfaces</p>
  <pre><code>export interface IUserInfo {
    userName: string;
    passWord: string;
    tenantId: string;
  }
  export interface IUser {
    id: string;
    name: string;
    email: string;
    phone: string;
    tenantId: string;
  }
  
  export interface IUserValidationService{
    validateUser (UserInfo : IUserInfo) : Observable&lt;any&gt;
  }
  </code></pre>
  <p>I have integrated this client library in another running nest application.</p>
  <pre><code>  @Post('auth/token')
    @HttpCode(200)
    async token(
      @Body() tokenRequest: TokenRequestDTO,
      @Headers() headers,
    ): Promise&lt;Object&gt; {
      this.logger.info('Inside token request');
  
      this.helper.validateRequestBody(tokenRequest);
      this.helper.validateHeader(headers);
  
      var response =  this.userGrpcClient.validateUser({
        userName: 'test',
        passWord: 'test',
        tenantId: 'test',
      })
  
      console.log(response);
      return await this.authService.provideToken(tokenRequest, headers);
    }
  </code></pre>
  <p>when I run this, there is no error. the response that I logged shows
  Observable { _isScalar: false, _subscribe: [Function] }</p>