From the course: Building Java Microservices with gRPC

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Implement service stub

Implement service stub

From the course: Building Java Microservices with gRPC

Start my 1-month free trial

Implement service stub

- [Instructor] Now that we have the entire database code set up, the connection, the query, everything, let's move on to the service implementation. So let's go to the IDE. So this was our DB code. Now let's recollect that we have generated the stubs and those stubs sit in the target folder. And under that, we have the service class which is UserServiceGrpc. That is the class now that we want to extend and implement the method of get user details. So let's do that next. Let's close this and let's basically close all of these files. Let's add a package here. This will be com.shopping.service and let's add a class which is UserService and since it is the implementation of the stub, I'll call it, impl. Now this class should basically extend the User service grpc. This is the wrong import. In case you're not able to see that class, you just have to go to the Maven tab, refresh the project once more to make sure…

Contents