protocol-buffers

grpc can't find protobuf libray

大憨熊 提交于 2020-07-09 11:57:46
问题 I went over the grpc installation and finished building and installation. Now when I try to: find_package(gRPC CONFIG REQUIRED) I get CMake Error at CMakeLists.txt:15 (find_package): Found package configuration file: /usr/lib64/cmake/grpc/gRPCConfig.cmake but it set gRPC_FOUND to FALSE so package "gRPC" is considered to be NOT FOUND. Reason given by package: The following imported targets are referenced, but are missing: protobuf::libprotobuf protobuf::libprotoc Event though find_package

How to cast inner classes from Dynamic Message in Protobuf?

为君一笑 提交于 2020-06-29 03:37:54
问题 I am converting my protobuf response ( byte[] ) to Dynamic message by using following code block DynamicMessage message = DynamicMessage.parseFrom((Descriptors.Descriptor type, byte[] data) By using getField() , I am able to get field values in the form of java objects, FieldDescriptor fieldDescriptor = message.getDescriptorForType().findFieldByName("fieldXyz"); Object A = message.getField(fieldDescriptor); But I want to cast the value to original protobuf class. For example in this object A

how to send messages between clients through server using grpc?

狂风中的少年 提交于 2020-06-27 17:38:06
问题 i am trying to create a program so clients are able to send messages to each other. So when a client sends a message, that message is sent to the server which sends it on to the recipient client. the problem im having is that there is no way for the server to send messages to a client without that client sending a message first so how can a client simply receive a message from another client through the server if its not sending anything first. this is my proto file: service Messenger { rpc

How to deal with unknown protobuf fields in Java?

人盡茶涼 提交于 2020-06-27 13:08:29
问题 I have a Java application that reads some protobuf data from another computer and can then modify some values and write it back. It is very likely that a user could read the data using an outdated .proto file, so there would be some fields it doesn't understand in this case. I would ultimately like to preserve the uknown data when writing back the changes made; however, I could settle for just detecting that there is unknown data (to prompt the user to upgrade his/her application). It is not

How do I Import a .proto file from a dependency jar using gradle

好久不见. 提交于 2020-06-27 11:58:08
问题 I have a project that creates a set of protobuf objects and GRPC stubs. I have a dependency on a jar with other .proto files in it, that I would like to use in my project. ie: project-abc-0.0.1.jar contains a file: /some-types.proto It contains these pieces: package foo_companyname; message StatusItem { string status = 1; string statusDescription = 2; } my project has a build.gradle file where I am trying to import it like so: buildscript { dependencies { classpath 'com.google.protobuf

How to handle the generic type Object with protocol buffers, in the .proto file?

余生颓废 提交于 2020-06-24 07:33:21
问题 I've spent some time looking for some alternative to handle generic objects, I've seen questions similar to mine, but not as specific I suppose? Protocol buffers has multiple scalar types that I can use, however they are mostly primitive. I want my message to be flexible and be able to have a field that is a List of some sort. Let's say my .proto file looked like this: message SomeMessage { string datetime = 1; message inputData // This would be a list { repeated Object object = 1; } message

decode websocket received data

落爺英雄遲暮 提交于 2020-06-23 08:11:35
问题 I am working on project of my own website where I need to scrape data from target site using websocket. Data is live feed or tick for price movement of currency and stocks. I am getting output in following format. try on http://websocket.org/echo.html : Location: wss://streamer.finance.yahoo.com/ Click on Connect. Message: {"subscribe":["AMZN"]} OUTPUT: CONNECTED SENT: {"subscribe":["AMZN"]} RECEIVED: CgRBTVpOFaQY3EQY4Kn0/99bKgNOTVMwCDgBRYjKzDxIyvN9ZQBQ4T7YAQQ= RECEIVED: CgRBTVpOFaQY3EQY4Kn0

How to Maintain Proto Files?

做~自己de王妃 提交于 2020-06-16 04:23:53
问题 I've created 3 proto files and would like to keep it in a git repo: separated from all others files. The repository contains only .proto files . I have 3 microservices and each of them has their own repository that is using those proto files to communicate with each others: You can see on the picture above, that proto files are consuming from different microservices. Assume, I am going to change the Protofile2 and push the changes to proto repository, remember proto files repository are

Error using import in .proto file

人走茶凉 提交于 2020-06-09 11:40:26
问题 I tried importing a proto file named test1.proto to another proto file named test2.proto using the import statement import "com/test/test1.proto"; But i get the following error com/test/test1.proto: File not found. test2.proto: Import "com/test/test1.proto" was not found or had errors. I tried in many ways to find the cause of the import error but couldn't. So could someone please tell me the correct way of doing proto file imports in case there is something wrong with the above statement??

protoc custom plugin erroring out with Program not found or is not executable

半城伤御伤魂 提交于 2020-06-09 05:37:45
问题 I am trying to build a custom protoc plugin to generate custom output from .proto files. I literally copied java file containing CodeGenerator from protoc custom plugin as a starting point and renamed it. I also followed executable and created .sh file. The content of my shell script is as follows. I also add the PATH variable value and output of the plugin execution. Can someone point me where I am going wrong with this? The shell script runs fine separately executing the main method 回答1: