{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/1196","labels_url":"https://api.github.com/repos/grpc/grpc-java/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-java/issues/1196/comments","events_url":"https://api.github.com/repos/grpc/grpc-java/issues/1196/events","html_url":"https://github.com/grpc/grpc-java/issues/1196","id":116127488,"number":1196,"title":"Java to Java RPC calls, without the proto IDL files and Proxy apart from stub.","user":{"login":"supercharger","id":665516,"avatar_url":"https://avatars.githubusercontent.com/u/665516?v=3","gravatar_id":"","url":"https://api.github.com/users/supercharger","html_url":"https://github.com/supercharger","followers_url":"https://api.github.com/users/supercharger/followers","following_url":"https://api.github.com/users/supercharger/following{/other_user}","gists_url":"https://api.github.com/users/supercharger/gists{/gist_id}","starred_url":"https://api.github.com/users/supercharger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supercharger/subscriptions","organizations_url":"https://api.github.com/users/supercharger/orgs","repos_url":"https://api.github.com/users/supercharger/repos","events_url":"https://api.github.com/users/supercharger/events{/privacy}","received_events_url":"https://api.github.com/users/supercharger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-10T15:19:37Z","updated_at":"2015-11-19T01:20:30Z","closed_at":null,"body":"In Java, the builtin RPC mechanism \"RMI\" and serialization mechanism is very old, and has many severe issues with timeouts, soft versioning, etc. So, with distributed java to java services which happens naturally when the services are evolved over time, the following kind of API is preferred which is a Java Proxy based instead of stub.\r\n\r\n``` java\r\n\r\nExampleService exampleService = grpcClientManager.get(ExampleService.class).build();\r\nexampleService.sayHello();\r\n\r\npublic interface ExampleService {\r\n    public String sayHello();\r\n    public Future<String> sayHi();\r\n}\r\n```\r\n\r\nFor Java-to-Java calls, Building stubs and IDL files are unintuitive and extra efforts, better to make use of marking the interfaces with annotations.  I searched and found a similarly implemented library called  [Swift](https://github.com/facebook/swift) for Thrift . It would be great if grpc supports annotation based one, \r\n\r\nEx:https://github.com/facebook/fbthrift/blob/master/thrift/tutorial/java/swift/client/src/main/java/com/facebook/swift/exampleclient/ExampleService.java\r\n\r\nI feel it is easier and simple, with Java proxy apart from stub. We will be able to always generate the proto IDL files from the java source for RPC with other languages."},"comment":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/comments/157916025","html_url":"https://github.com/grpc/grpc-java/issues/1196#issuecomment-157916025","issue_url":"https://api.github.com/repos/grpc/grpc-java/issues/1196","id":157916025,"user":{"login":"supercharger","id":665516,"avatar_url":"https://avatars.githubusercontent.com/u/665516?v=3","gravatar_id":"","url":"https://api.github.com/users/supercharger","html_url":"https://github.com/supercharger","followers_url":"https://api.github.com/users/supercharger/followers","following_url":"https://api.github.com/users/supercharger/following{/other_user}","gists_url":"https://api.github.com/users/supercharger/gists{/gist_id}","starred_url":"https://api.github.com/users/supercharger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supercharger/subscriptions","organizations_url":"https://api.github.com/users/supercharger/orgs","repos_url":"https://api.github.com/users/supercharger/repos","events_url":"https://api.github.com/users/supercharger/events{/privacy}","received_events_url":"https://api.github.com/users/supercharger/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T01:20:30Z","updated_at":"2015-11-19T01:20:30Z","body":"@louiscryan  I think  to integrate with Grpc, all we need to is use protostuff-runtime to \"serialize to inputstream\", \"deserialize from inputstream\" using the http://www.protostuff.io/documentation/runtime-schema/#usage\r\n\r\n```java\r\nbyte[] protostuff = ProtostuffIOUtil.toByteArray(foo, schema, buffer);\r\n//build inputstream from byte array\r\n```\r\n\r\nAs for RPC, There is no support from  [protostuff for RPC](https://github.com/protostuff/protostuff/wiki/Rpc-Services) **except that it allows to generate the code** for which we already have Grpc. But, it is very useful in marshalling of java annotated objects to protobuf format which can be used in Grpc.\r\n\r\n"}}