即使服务正确注册也找不到 Fabio grpc 路由

问题描述 投票:0回答:0

我想弄清楚为什么我的 fabio 服务没有正确重新路由。 这是我正确注册的路由表

  • 服务:event-grpc-service
  • 来源:/event-grpc-service
  • 目的地:grpc://event.grpc:81
  • 选项:strip=/event-grpc-service

grpc 只有一种方法,您可以在下面查看更多详细信息。我试着打电话

  • localhost:9999/event-grpc-service <- This one should be a route registered in fabio
  • localhost:9999/event-grpc-service/Event
  • localhost:9999/event-grpc-service/Event/GetEvent

All 在fabio中打印如下日志

2023/03/19 19:39:45 [WARN] No route for *

有人可以帮我解决吗?

下面是关于如何设置的更多信息。

  consul:
    image: consul
    container_name: consul
    restart: unless-stopped
    networks:
      - odin
    ports:
      - 8500:8500
    volumes:
      - consul:/consul/data
  
  fabio:
    image: fabiolb/fabio
    container_name: fabio
    restart: unless-stopped
    environment:
      - FABIO_REGISTRY_CONSUL_ADDR=consul:8500
    networks:
      - odin
    ports:
      - 9998:9998
      - 9999:9999

这里还有原型文件:

syntax = "proto3";

option csharp_namespace = "Event.Grpc";

import "google/protobuf/timestamp.proto";


package event.protos;

service Event {
  rpc GetEvent (GetEventRequest) returns (EventResponse);
}

message GetEventRequest {
  int64 id = 1;
}

message EventResponse {
  int64 id = 1;
  string name = 2;
  google.protobuf.Timestamp starting = 3;
  string category = 4;
  repeated Market markets = 5;
}

message Market {
  string name = 1;
  StakeLimits stake_limits = 2;
  repeated Selection selections = 3;
}

message StakeLimits
{
  DecimalValue minStake = 1;
  DecimalValue maxStake = 2;
}

message Selection {
  string name = 1;
  DecimalValue price = 2;
}

message DecimalValue {
  // Whole units part of the amount
  int64 units = 1;

  //Nano units of the amount (10^-9)
  //Must be the same sign as units
  sfixed32 nanos = 2;
}
docker grpc load-balancing consul fabio
© www.soinside.com 2019 - 2024. All rights reserved.