protocol-buffers

Google Protobuf dependency collision

*爱你&永不变心* 提交于 2020-03-26 02:36:45
问题 I am working on a Golang library that leverages Google Protobuf. It does so by using code auto-generated by protoc-gen-go, the compiler plugin. I am using Dep for dependency management. The generated code exports the InstanceStatusUpdate struct, for which the field Timestamp is of the type github.com/golang/protobuf/ptypes/timestamp.Timestamp : type InstanceStatusUpdate struct { EvaluationId string VariationId string AttemptNumber int32 Timestamp *google_protobuf.Timestamp Stage string

Go converting ptypes/struct Value to BSON

跟風遠走 提交于 2020-03-23 09:50:08
问题 Requirements Two services: Server - for writing blog posts to MongoDB Client - sends request to the first service The blog post has title of type string , and content which is a dynamic type - can be any JSON value. Protobuf syntax = "proto3"; package blog; option go_package = "blogpb"; import "google/protobuf/struct.proto"; message Blog { string id = 1; string title = 2; google.protobuf.Value content = 3; } message CreateBlogRequest { Blog blog = 1; } message CreateBlogResponse { Blog blog =

Using Spring Boot together with gRPC and Protobuf

我的梦境 提交于 2020-03-17 04:07:07
问题 Anyone having any examples or thoughts using gRPC together with Spring Boot? 回答1: If it's still relevant for you, I've created gRPC spring-boot-starter here. grpc-spring-boot-starter auto-configures and runs the embedded gRPC server with @GRpcService-enabled beans. The simplest example : @GRpcService(grpcServiceOuterClass = GreeterGrpc.class) public static class GreeterService implements GreeterGrpc.Greeter { @Override public void sayHello(GreeterOuterClass.HelloRequest request,

Does Google/Firebase android SDKs use GRPC?

怎甘沉沦 提交于 2020-03-05 09:33:09
问题 Recently I've been working on integrating a GRPC API in a size sensitive android app. The API only had a couple of Unary calls. I noticed that the resulting APK had io.grpc (613KB) & io.opencensus (178.9KB) which was further reduced to 387.2KB and 39.4KB respectively using Proguard. I noticed that Proguard was able to remove many streaming call related classes/methods from the APK. However, I noticed that the app already had com.google.protobuf package, which I suspect is from something like

Receive delimited Protobuf message in python via TCP

╄→尐↘猪︶ㄣ 提交于 2020-02-23 05:00:33
问题 I am trying to receive a protobuf message, which was send from a java application with "writeDelmitedTo()" inside my python application. After some research I already came across this code to read the message from the socket, decode it and parse it. data = sock.recv() (size, position) = decoder._DecodeVarint(data, 0) msg = MessageWrapper_pb2.WrapperMessage().ParseFromString(data[position:position + size]) What I am getting now is a google.protobuf.message.DecodeError: Truncated message

Protobuf, CodedInputStream parsing partial messages

随声附和 提交于 2020-02-22 08:44:08
问题 I'm trying to implement protobuf sending/receiving that's compatible with the java version, which includes a varint32-prefix first. I've almost got it working, but for some reason some messages become partial and fail an assert(). /receiver.cpp:69: void tcp_connection::handle_read_message(const boost::system::error_code&, size_t): Assertion `line.ParseFromCodedStream(&input)' failed. semder.pp boost::asio::streambuf buffer; std::ostream writer(&buffer); bool packet_full = false; uint32_t sent

Protobuf, CodedInputStream parsing partial messages

这一生的挚爱 提交于 2020-02-22 08:43:57
问题 I'm trying to implement protobuf sending/receiving that's compatible with the java version, which includes a varint32-prefix first. I've almost got it working, but for some reason some messages become partial and fail an assert(). /receiver.cpp:69: void tcp_connection::handle_read_message(const boost::system::error_code&, size_t): Assertion `line.ParseFromCodedStream(&input)' failed. semder.pp boost::asio::streambuf buffer; std::ostream writer(&buffer); bool packet_full = false; uint32_t sent

Protobuf, CodedInputStream parsing partial messages

一世执手 提交于 2020-02-22 08:43:50
问题 I'm trying to implement protobuf sending/receiving that's compatible with the java version, which includes a varint32-prefix first. I've almost got it working, but for some reason some messages become partial and fail an assert(). /receiver.cpp:69: void tcp_connection::handle_read_message(const boost::system::error_code&, size_t): Assertion `line.ParseFromCodedStream(&input)' failed. semder.pp boost::asio::streambuf buffer; std::ostream writer(&buffer); bool packet_full = false; uint32_t sent

Duplicate class in protobuf lite and protobuf java

不想你离开。 提交于 2020-02-22 05:13:31
问题 I'm using grpc with protobuf lite in android implementation. but protobuf lite doesn't have google time stamp, and my protos has import "google/protobuf/timestamp.proto". so i added implementation 'com.google.protobuf:protobuf-java:3.7.1' to gradle that contains google time stamp. but after that code compilaition has errors. such as :Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.7.1.jar (com.google.protobuf:protobuf-java:3.7.1) and protobuf-lite-3.0

Duplicate class in protobuf lite and protobuf java

放肆的年华 提交于 2020-02-22 05:12:55
问题 I'm using grpc with protobuf lite in android implementation. but protobuf lite doesn't have google time stamp, and my protos has import "google/protobuf/timestamp.proto". so i added implementation 'com.google.protobuf:protobuf-java:3.7.1' to gradle that contains google time stamp. but after that code compilaition has errors. such as :Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.7.1.jar (com.google.protobuf:protobuf-java:3.7.1) and protobuf-lite-3.0