Hi everyone,
I’m currently testing out gRPC with .NET Core and hit the following error when attempting to add a timestamp field to my proto file:
My proto file was as follows:
import “google/protobuf/timestamp.proto”;
option csharp_namespace = “publisher_api”;
package Weather;
// The weather forecast service definition
service Weather {
// Gets weather forecast
rpc Forecast(WeatherForecastRequest) returns (WeatherForecastResponse);
}
// The request message
message WeatherForecastRequest {
}
// The response message
message WeatherForecastResponse {
timestamp date = 1;
int32 temperatureC = 2;
int32 temperatureF = 3;
string summary = 4;
}
The solution was to fully qualify the timestamp namespace:
message WeatherForecastResponse {
google.protobuf.Timestamp date = 1;
int32 temperatureC = 2;
int32 temperatureF = 3;
string summary = 4;
}
…
Also ensure that you’ve added the protobuff package:
See the following repo for a full example: https://github.com/Buzzology/microservicesDockerRabbitMQ
Leave a Reply