Hi lichen, can you elaborate on what you mean by "letting each node talk to each other"? Is this a service discovery problem that you're describing?
gRPC understands how to connect to target hosts directly, and how to resolve DNS names to a set of equivalent backend hosts (in Java this is via the DnsNameResolver). It is also possible to have custom NameResolver classes that are powered by mechanisms other than DNS, but this plug in API is an experimental feature that may be change in the future. These two classes may be useful in solving your problem. If A knows the hostname for B, then it can create a direct connect to it, as shown in the examples. If A knows of shard_c, and just needs some way to talk to any machine in shard_c, then using the NameResolver may be the solution. On Tue, Jun 27, 2017 at 11:02 PM, <[email protected]> wrote: > Hey experts, > > As a newbie to gRPC, i was wondering how, if it's feasible at all, I could > use gRPC to implement intra nodes communication within a cluster. Imagine > each node would both send and receive some msgs from other nodes. Such msg > could be say heartbeat or command that A want B to execute. Imagine this is > to implement some sort of consensus algorithm(say Paxos or Raft). > > From gRPC "hello world" example I can see there are clear client/server > relationship between nodes sitting at two ends of service. But how could i > manage to achieve above goal of letting each node talk to each other? is > there any code/doc example that you guys suggest i should look into? > > > > Thanks a lot! > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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/7f70cebd-31ea-4863-9a98-bb0f80946318%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/7f70cebd-31ea-4863-9a98-bb0f80946318%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Spencer Fang -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAK%3D-x_7fGioWCgDctNCZ2Zyod3uDU6ijiXW-saRbYspfvrSjgQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
