Share data between interceptor and service gRPC

Let’s imagine that we need to pass data between the interceptor and the service (or we need to sharedata between the interceptor and the service, or we need to exchange data between the interceptor and the service). We have a service: We have the code for starting the gRPC server: In your Interceptor class, in […]

READ MORE

Get client IP address from request gRPC

Let’s imagine that we need to get the client’s ip address from the request.  We have a service:  And the code for starting the gRPC server:  Let’s create a new class:  And register a new interceptor in the gRPC server launch code:  Done. If you need to pass the ip address from the interceptor to the […]

READ MORE

HBase client 1.x with gRPC

Imagine, that you need to use the HBase client 1.x and gRPC in the same Java application. The code for connecting dependencies to Maven will look something like this: If you run the application and execute the request through the HBase client, there will be an exception: The problem is that hbase-client 1.x uses an earlier […]

READ MORE

Spring Boot REST vs gRPC compatibility

Suppose you are using Spring Boot and you have a REST controller: At some point you need to connect the gRPC to the project without disabling REST controller. The gRPC code looks something like this: Then you find out that you can’t start REST server together with gRPC. gRPC will start, but REST will not. […]

READ MORE