[grpc-io] Custom Endpoint

2016-10-05 Thread Robert Bielik
Hi all,

We have a customer for which the TCP endpoint seems not to work on their 
platform (ARMV7a based Linux), weird as that might be. So I'd like to look 
at implementing a custom endpoint to be used instead in such cases.

Question is if there are examples for this ?

Regards
/Robert

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/047dae09-b5d9-4863-b062-eff5c3e75ce1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Grpc C# Question on Reading from Response Stream

2016-10-05 Thread 'Jan Tattermusch' via grpc.io
Hi,

I skimmed through your code and it looks alright (perhaps I missed
something?). What line does throw in your case?

To answer your questions:

The response stream is ready immediately after starting your call and you
don't even need to send any requests nor close the request stream to be
able to read from responseStream (so your code really should work).
Also, if you need to just subscribe for server updates, perhaps the
bi-streaming call is an overkill - you could start a server-streaming call,
where you send a unary request (with you subscription details) and then
keep reading from the response stream (but your example should work).

Jan

On Tue, Oct 4, 2016 at 8:42 PM,  wrote:

> Hello,
>
> I am trying to work on a grpc C# client that initiates a subscription type
> call with a grpc server. I believe I sent the subscription correctly but am
> not able to read from the response stream correctly. I try to await on the
> AsyncEnumerator.MoveNext() task but I get a null reference exception on the
> below code.
>
> var asyncCall = client.Subscribe();
> var responseStream = asyncCall.ResponseStream;
>
> await asyncCall.RequestStream.CompleteAsync();
>
> while (await responseStream.MoveNext())
> {
> var tresp = asyncCall.ResponseStream.Current;
> // print tresp message.
> }
>
> After having sent an RPC call, does the ResponseStream get initialized
> immediately ? My guide for this has been https://github.com/grpc/grpc/
> blob/v1.0.0/examples/csharp/route_guide/RouteGuideClient/Program.cs.
>
> Thanks,
> Naman
>
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To post to this group, send email to grpc-io@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/3c54b44d-bdeb-48c3-a0c3-c804dca2ca87%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CACF4M0QcHtNnnLTo_UwPCokDJn22xdi23hMyM3-A6_m30DZOEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Re: gRPC on .NET core: how can I help

2016-10-05 Thread 'Jan Tattermusch' via grpc.io
Hi Alex,

Andreas is totally right. .NET core support is code complete and it will
get published soon.

Jan

On Wed, Oct 5, 2016 at 1:11 AM,  wrote:

> Hi Alex,
>
> See https://github.com/grpc/grpc/pull/8107
>
> gRPC master already supports .NET core, so the upcoming 1.0.1 will support
> it.
>
> There are also builds from master on nuget (https://www.nuget.org/
> packages/X.Grpc/1.1.0-dev-20160831) but be careful with those.
>
> I'm sure you testing it will help.
>
> Am Montag, 3. Oktober 2016 11:39:32 UTC+1 schrieb Alex Van Boxel:
>>
>> Hi guys,
>>
>> I saw a few discussion about .NET core support and that it's WIP. What is
>> the status, and how can I help. We're on a turning point at the company I
>> work, we're focused on .NET but what to go to the containers world. .NET
>> Core on Linux seems like a good transition, later on we can look for other
>> languages and frameworks.
>>
>> But we want to look at gRPC as well. That's why I'm wondering about the
>> status. Who can I contact?
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To post to this group, send email to grpc-io@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/1a9d5785-2c35-4459-9922-1e1027055061%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CACF4M0TPAib8gyOZa4A2pB9_TesBD_TjtD01LOEU10DBdyJ9VQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Repeated returns empty, Java 8, Maven, NetBeans 8.1

2016-10-05 Thread Tim McManamey
I want to return a List of strings using gRPC.  In my program it seams to 
add a string to the repeated value fine, but when I return the value to the 
calling program it's empty.  Here is my code:

my.proto

syntax = "proto3";

option java_multiple_files = true;
option java_package = my.package.name.testsend";
option java_outer_classname = "TestSendProto";
option objc_class_prefix = "TS";

package testsend;

// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}
  rpc SayHelloAgain (HelloRequest) returns (ArrayHelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}

message ArrayHelloReply {
repeated string message2 = 2;
}

// server /
import io.grpc.Server;
import io.grpc.ServerBuilder;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
import java.util.logging.Logger;
import java.util.ArrayList;
import java.io.*;


/**
 *
 * @author yotimbo
 */
public class yoRecvo {
  private static final Logger logger = 
Logger.getLogger(yoRecvo.class.getName());

  /* The port on which the server should run */
  private int port = 50051;
  private Server server;

  private void start() throws IOException {
server = ServerBuilder.forPort(port)
.addService(new GreeterImpl())
.build()
.start();
logger.info("Server started, listening on " + port);
Runtime.getRuntime().addShutdownHook(new Thread() {
  @Override
  public void run() {
// Use stderr here since the logger may have been reset by its JVM 
shutdown hook.
System.err.println("*** shutting down gRPC server since JVM is 
shutting down");
yoRecvo.this.stop();
System.err.println("*** server shut down");
  }
});
  }

  private void stop() {
if (server != null) {
  server.shutdown();
}
  }

  /**
   * Await termination on the main thread since the grpc library uses 
daemon threads.
   */
  private void blockUntilShutdown() throws InterruptedException {
if (server != null) {
  server.awaitTermination();
}
  }

  /**
   * Main launches the server from the command line.
   */
  public static void main(String[] args) throws IOException, 
InterruptedException {
final yoRecvo server = new yoRecvo();
server.start();
server.blockUntilShutdown();
  }

  private class GreeterImpl extends GreeterGrpc.GreeterImplBase {

@Override
public void sayHello(HelloRequest req, StreamObserver 
responseObserver) {
  HelloReply reply = HelloReply.newBuilder().setMessage("Hello " + 
req.getName()).build();
  responseObserver.onNext(reply);
  responseObserver.onCompleted();
}
@Override
public void sayHelloAgain(HelloRequest req, 
StreamObserver responseObserver) {
String str = new String("Yo Dude");
final Logger logger = Logger.getLogger(yoRecvo.class.getName());

ArrayHelloReply arrayHelloReply = 
ArrayHelloReply.newBuilder().build();

logger.info("number of elements " + 
arrayHelloReply.getMessage2Count());

  
  responseObserver.onNext(arrayHelloReply);
  responseObserver.onCompleted();
}
 }
}

/// client //

import com.google.protobuf.Descriptors;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.StatusRuntimeException;
import java.util.List;

import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author yotimbo
 */
public class yoSendo {
private static final Logger logger = 
Logger.getLogger(yoSendo.class.getName());
private final ManagedChannel channel;  //gRPC class, only needed for 
server
private final GreeterGrpc.GreeterBlockingStub blockingStub;

public yoSendo(String host, int port) {
channel = ManagedChannelBuilder.forAddress(host, port)
.usePlaintext(true)
.build();
blockingStub = GreeterGrpc.newBlockingStub(channel);  //Greeter is 
from proto service, Grpc must be appended
}

public void shutdown() throws InterruptedException {
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
  }

  /** Say hello to server. */
  public void greet(String name) {
List mylist;
logger.info("Will try to greet " + name + " ...");
HelloRequest request = HelloRequest.newBuilder().setName(name).build();
HelloReply response;
ArrayHelloReply arrayResponse;
try {
  response = blockingStub.sayHello(request);
} catch (StatusRuntimeException e) {
  logger.log(Level.WARNING, "RPC failed: {0}", e.getStatus());
  return;
}   
logger.info("Greeting: " + response.getMessage());
try {
  arrayResponse = blockingStub.sayHelloAgain(requ

[grpc-io] Java Serverside flow control with ServerCallStreamObserver

2016-10-05 Thread dan . jasek
I am playing around with the experimental flow control functionality in 
ServerCallStreamObserver.
My goal is to wire up bi-directional calls into RxJava pipelines.  For the 
most part gRPC and Rx wire together easily.  If you are interested, my very 
initial setup is 
here: https://gist.github.com/oillio/75ffadfd44c30497a4e8cf6476eff438

I've got a couple questions on how flow control works.

>From what I can see, the request-side flow control is actually managed 
through the passed in responseObserver object.
In order to take control, I should do something along the lines of:
((CallStreamObserver) responseObserver).disableAutoInboundFlowControl();

Then, I can request additional messages through:
((CallStreamObserver) responseObserver).request(1);

Is this the recommended way to do this?
Is there a way, or plans to provide a way, to manage flow control through 
the request StreamObserver returned by the application code handler?
This is a bit awkward for my use case as my request StreamObserver will 
need to keep a reference to the response StreamObserver in order to manage 
the request-side flow control.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/076f37c1-1d22-4e04-8be9-15a4962b4a63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: Building grpc-java on Power8

2016-10-05 Thread nishidha27
Hello Eric,

I'm still stuck with error while running command 
./gradlew build -Pprotoc=/usr/local/bin/protoc -Pprotoc-gen-javalite=/usr/
local/bin/protoc-gen-javalite

I'm seeing below error despite building netty-tcnative on Power -
:grpc-interop-testing:test[jetty-alpn-agent] Using: 
alpn-boot-8.1.7.v20160121.jar


io.grpc.testing.integration.Http2NettyTest > classMethod FAILED
java.lang.UnsatisfiedLinkError: failed to load the required native 
library
at io.netty.handler.ssl.OpenSsl.ensureAvailability(OpenSsl.java:241)
at 
io.netty.handler.ssl.OpenSslContext.(OpenSslContext.java:169)
at 
io.netty.handler.ssl.OpenSslServerContext.(OpenSslServerContext.java:347)
at 
io.netty.handler.ssl.OpenSslServerContext.(OpenSslServerContext.java:337)
at 
io.netty.handler.ssl.SslContext.newServerContextInternal(SslContext.java:413)
at 
io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:391)
at 
io.grpc.testing.integration.Http2NettyTest.startServer(Http2NettyTest.java:70)

Caused by:
java.lang.IllegalArgumentException: Failed to load any of the given 
libraries: [netty-tcnative-linux-ppcle_64, 
netty-tcnative-linux-ppcle_64-fedora, netty-tcnative]
at 
io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:167)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:325)
at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:90)
at 
io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:137)
at 
io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:119)
at 
io.grpc.netty.GrpcSslContexts.forServer(GrpcSslContexts.java:100)
at 
io.grpc.testing.integration.Http2NettyTest.startServer(Http2NettyTest.java:65)

212 tests completed, 1 failed, 4 skipped
:grpc-interop-testing:test FAILED


I tried copying the generated jar of netty-tcnative at 
$HOME/.gradle/cache/modules/file*/io.netty/netty-tcnative. Could you please 
help me with this setting?

Thanks,
Nishidha

On Thursday, 14 July 2016 17:15:24 UTC+5:30, nishi...@gmail.com wrote:
>
>
> Hi,
>
> I'm trying to build grpc-java on Power8 in order to build bazel 0.3.0 
> (need protoc-gen-grpc-java built on power). However, I'm getting below 
> errors while doing so -
> A problem occurred configuring project ':grpc-compiler'.
> > Exception thrown while executing model rule: 
> NativeComponentRules#createBinaries
> > Invalid NativePlatform: ppcle_64
>
> Could anyone please guide me on how to build grpc-java on Power? I've also 
> gone through a similar post for "arm" but it didn't help. Looks like some 
> other places also need to be modified in order to add support for Power. 
> Not sure if skipcodegen=true is expected in my case, but I've also tried 
> that and it also fails for missing netty-tcnative-boring-ssl jar for Power.
>
> Thanks in advance,
> Nishidha
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/9131ddd8-298a-4bc1-af27-4036e0d0604a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Strategy for distributing protobuf APIs

2016-10-05 Thread Mario Steinhoff
Hey, thanks everyone for your feedback. :)

I decided to move all .proto files from the service projects into a
separate API project. The API project is language-agnostic but could
be used for distributing language-specific generated code in the
future, if this ever becomes a requirement.

The .proto files are copied from the API project into each individual
service project for now. In the future I can replace manual copying
with jar dependencies including only the .proto files. I still need to
figure out the details how to manage changes in the .proto APIs
without breaking backwards-compatibility, but protobuf seems to make
this easy.

Distributing generated code does not make sense for us for now, as we
are a very small shop and only use Java. Thus the language-specific
code is also generated in every service project. This allows me to
make all service builds fully independent from each other, and I can
also update grpc-java independently in each service.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CACHcfZo%3DUBzYVDaWOOr7i%2B_xcVEquHw6nAnGqkD2LnqTVSqkjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: Is Python the runt of the litter?

2016-10-05 Thread rautelap
Python?

Think of Dinosaurs like me who are using C and thus cannot use gRPC at all.

:-)

On Thursday, 8 September 2016 09:05:29 UTC-7, JI Ioannidis wrote:
>
> I'm wondering why Python support in grpc is so poor? It has not improved 
> in the last 4-5 months that I've been working with it. The documentation is 
> nothing but the doc strings from the source, the examples are trivial, 
> there is no discussion on how to do elementary things such as 
> authentication. I'm basically going on what I remember from my Google days, 
> but that's already three years old.
>
> I wouldn't mind switching to C++, except that our code does a lot of AWS 
> API calls, and their support for C++ is not where it should be. I really 
> don't want to use java, and we don't have enough people who know go to 
> switch the codebase to go. 
>
> Advice?
>
> /ji
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/83596d1e-34bf-42ef-bd18-59b1fc744d91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] gRPC with C programs

2016-10-05 Thread rautelap
Hi,

So, I have a rather embarrasing question.

We have a distributed system with a lot of services in C, which use 
protobuf2.

I want to use gRPC for our Data access Layer (not ready yet), and thus 
decided to use go lang.

But the rest of the services are C based and since gRPC needs 
protobuf3(which does not have a C compiler), I am stuck for now.

Suggestions on what approaches I can take, apart from manually write a 
library layer which converts between proto2 and proto3 before feeding to a 
gRPC client stub or gRPC server.

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d1ebecc4-f9bb-44da-8e1f-33966fc0523e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.