{"id":23237,"date":"2024-09-07T16:10:55","date_gmt":"2024-09-07T09:10:55","guid":{"rendered":"https:\/\/huongdanjava.com\/?p=23237"},"modified":"2025-07-16T11:03:08","modified_gmt":"2025-07-16T04:03:08","slug":"introduction-to-grpc","status":"publish","type":"post","link":"https:\/\/huongdanjava.com\/introduction-to-grpc.html","title":{"rendered":"Introduction to gRPC"},"content":{"rendered":"<p>RPC stands for Remote Procedure Call, which is a mechanism that allows you to call a function or method of a program on one machine from another machine. It&#8217;s similar to RMI, Remote Method Invocation, in Java! <a href=\"https:\/\/grpc.io\/\" target=\"_blank\" rel=\"noopener\">gRPC<\/a> is an open-source, high-performance framework implemented by Google for RPC. In this tutorial, I will introduce you to some basic knowledge about gRPC and implement an example to see how gRPC works!<\/p>\n<p>The first thing I need to tell you is that gRPC supports many different languages. For Java, we will use gRPC Java here <a href=\"https:\/\/grpc.io\/docs\/languages\/java\/\" target=\"_blank\" rel=\"noopener\">https:\/\/grpc.io\/docs\/languages\/java\/<\/a><\/p>\n<p>With gRPC, the message sent will be in binary form using the protocol buffer (protobuf). Simply put, the protocol buffer is a protocol that does not depend on programming language or platform, used to serialize structured data. Thanks to that, different languages \u200b\u200bcan serialize or deserialize gRPC messages easily.<\/p>\n<p>And gRPC uses HTTP\/2 to establish communication between parties!<\/p>\n<p>Now, I will try to make an example of creating a new gRPC server with Java and using Postman to call a method inside this gRPC server to see how gRPC works!<\/p>\n<p>I will create a new Maven project as an example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23239 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/09\/introduction-to-grpc-1.png\" alt=\"\" width=\"700\" height=\"712\" \/><\/p>\n<p>We need to declare gRPC dependencies as follows:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;dependencyManagement&gt;\r\n  &lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;io.grpc&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;grpc-bom&lt;\/artifactId&gt;\r\n      &lt;version&gt;${grpc.version}&lt;\/version&gt;\r\n      &lt;type&gt;pom&lt;\/type&gt;\r\n      &lt;scope&gt;import&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n  &lt;\/dependencies&gt;\r\n&lt;\/dependencyManagement&gt;\r\n\r\n&lt;dependencies&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;io.grpc&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;grpc-netty&lt;\/artifactId&gt;\r\n  &lt;\/dependency&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;io.grpc&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;grpc-stub&lt;\/artifactId&gt;\r\n  &lt;\/dependency&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;io.grpc&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;grpc-protobuf&lt;\/artifactId&gt;\r\n  &lt;\/dependency&gt;\r\n&lt;\/dependencies&gt;<\/pre>\n<p>with &#8220;grpc.version&#8221; having the following value:<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;properties&gt;\r\n  ...\r\n  \r\n  &lt;grpc.version&gt;1.73.0&lt;\/grpc.version&gt;\r\n&lt;\/properties&gt;<\/pre>\n<p><strong>We will start building the gRPC server by defining the services that the gRPC server provides using a .proto file.<\/strong><\/p>\n<h3>Define service contract<\/h3>\n<p>The content of this .proto file will define the protocol and service contract in the format of Google Protocol Buffer!<\/p>\n<p>I will create a new helloworld.proto file in the \/src\/main\/proto folder:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23240 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/09\/introduction-to-grpc-2.png\" alt=\"\" width=\"700\" height=\"774\" \/><\/p>\n<p>to define a simple service that returns the text &#8220;Hello &lt;name&gt; from Huong Dan Java&#8221; when called.<\/p>\n<p>The contents of this .proto file are as follows:<\/p>\n<pre class=\"lang:java decode:true\">syntax = \"proto3\";\r\n\r\noption java_multiple_files = true;\r\n\r\npackage com.huongdanjava.grpc;\r\n\r\nmessage HelloRequest {\r\n  string name = 1;\r\n}\r\n\r\nmessage HelloResponse {\r\n  string message = 1;\r\n}\r\n\r\nservice HelloService {\r\n  rpc hello(HelloRequest) returns (HelloResponse);\r\n}<\/pre>\n<p>Protocol Buffer currently has 2 versions: 2 and 3. I will use version 3 as you can see in the <em>syntax = &#8220;proto3&#8221;<\/em> line above.<\/p>\n<p>After defining the service contract using the .proto file, we will use <a href=\"https:\/\/grpc.io\/docs\/protoc-installation\/\" target=\"_blank\" rel=\"noopener\">gRPC&#8217;s Protocol Buffer Compiler tool<\/a> to generate source code. By default, this tool will generate Java code into a .java file. We use the<em> java_multiple_files = true<\/em> option to change this default configuration. Then, the Protocol Buffer Compiler will generate separate .java files!<\/p>\n<p>We define the package using the package keyword like in Java!<\/p>\n<p>To define the messages that will be used to exchange between systems with gRPC, we use the <em>message<\/em> keyword along with defining the content of that message. As in the example above, I am defining 2 different messages: HelloRequest and Hello Response. Each message will contain attributes along with the data type and order of these attributes in the message.<\/p>\n<p>The service keyword is used to define the services that gRPC will expose to the outside. Each service will contain many operations and we will use the <em>rpc<\/em> keyword to define these operations. As you can see, we will use messages as input and output for the operations.<\/p>\n<p>So we have a simple gRPC service contract. <strong>Now it&#8217;s time for us to use Protocol Buffer Compiler to generate Java code to implement this service.<\/strong><\/p>\n<p>You can refer to <a href=\"https:\/\/huongdanjava.com\/generate-java-code-for-service-contract-in-grpc-using-protocol-buffers-maven-plugin.html\" target=\"_blank\" rel=\"noopener\">this article<\/a> to generate Java code!<\/p>\n<p>After generating Java code, we need to implement the hello() method of the HelloServiceImplBase class in the HelloServiceGrpc file to complete our gRPC service.<\/p>\n<h3>Implement gRPC service<\/h3>\n<p>You can create a new class that extends the HelloServiceImplBase class and implement the hello() method as follows:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.grpc;\r\n\r\nimport io.grpc.stub.StreamObserver;\r\n\r\npublic class HelloServiceImpl extends HelloServiceGrpc.HelloServiceImplBase {\r\n\r\n  @Override\r\n  public void hello(HelloRequest request, StreamObserver&lt;HelloResponse&gt; responseObserver) {\r\n    String greeting = \"Hello \" + request.getName() + \" from Huong Dan Java\";\r\n\r\n    HelloResponse response = HelloResponse.newBuilder()\r\n        .setMessage(greeting)\r\n        .build();\r\n\r\n    responseObserver.onNext(response);\r\n    responseObserver.onCompleted();\r\n  }\r\n}\r\n<\/pre>\n<p>We will use the StreamObserver class object to return the result to the client every time there is a request, after building the HelloResponse object!<\/p>\n<p>Now, we will add code to implement the gRPC server in the main() method of the application as follows:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.grpc;\r\n\r\nimport io.grpc.Server;\r\nimport io.grpc.ServerBuilder;\r\nimport java.io.IOException;\r\n\r\npublic class Main {\r\n\r\n  public static void main(String[] args) throws IOException, InterruptedException {\r\n    Server server = ServerBuilder\r\n        .forPort(8080)\r\n        .addService(new HelloServiceImpl()).build();\r\n\r\n    server.start();\r\n    server.awaitTermination();\r\n  }\r\n}<\/pre>\n<p>We will run the gRPC server using port 8080 with the service pointing to the service we implemented above. As you can see, I used the Server class of gRPC Java to do this.<\/p>\n<p>We need to call the awaitTermination() method to keep the gRPC server running until we terminate the application!<\/p>\n<p>Now, if you run the application and use Postman to call the hello operation of the gRPC server with the message:<\/p>\n<pre class=\"lang:java decode:true \">{\r\n    \"name\": \"Khanh\"\r\n}<\/pre>\n<p>you will see the following results:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23241 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/09\/introduction-to-grpc-3.png\" alt=\"\" width=\"700\" height=\"383\" \/><\/p>\n<p>So we have implemented a basic gRPC server!<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;23237&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Introduction to gRPC&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>RPC stands for Remote Procedure Call, which is a mechanism that allows you to call a function or method of a program on one machine from another machine. It&#8217;s similar to RMI, Remote Method Invocation, in Java! gRPC is an open-source, high-performance framework implemented by&hellip; <a href=\"https:\/\/huongdanjava.com\/introduction-to-grpc.html\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":23196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2409],"tags":[],"class_list":["post-23237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-grpc-en","clearfix"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Introduction to gRPC - Huong Dan Java<\/title>\n<meta name=\"description\" content=\"In this tutorial, I introduce you to the gRPC, some basic knowledge, and an example of implementing a gRPC server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/huongdanjava.com\/introduction-to-grpc.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to gRPC - Huong Dan Java\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I introduce you to the gRPC, some basic knowledge, and an example of implementing a gRPC server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/huongdanjava.com\/introduction-to-grpc.html\" \/>\n<meta property=\"og:site_name\" content=\"Huong Dan Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-07T09:10:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-16T04:03:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/08\/grpc.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"880\" \/>\n\t<meta property=\"og:image:height\" content=\"704\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Khanh Nguyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/KhanhNguyenJ\" \/>\n<meta name=\"twitter:site\" content=\"@KhanhNguyenJ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khanh Nguyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html\"},\"author\":{\"name\":\"Khanh Nguyen\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"headline\":\"Introduction to gRPC\",\"datePublished\":\"2024-09-07T09:10:55+00:00\",\"dateModified\":\"2025-07-16T04:03:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html\"},\"wordCount\":707,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/grpc.jpg\",\"articleSection\":[\"gRPC\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html\",\"name\":\"Introduction to gRPC - Huong Dan Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/grpc.jpg\",\"datePublished\":\"2024-09-07T09:10:55+00:00\",\"dateModified\":\"2025-07-16T04:03:08+00:00\",\"description\":\"In this tutorial, I introduce you to the gRPC, some basic knowledge, and an example of implementing a gRPC server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#primaryimage\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/grpc.jpg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/grpc.jpg\",\"width\":880,\"height\":704},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/introduction-to-grpc.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/huongdanjava.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to gRPC\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/\",\"name\":\"Huong Dan Java\",\"description\":\"Java development tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/huongdanjava.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\",\"name\":\"Khanh Nguyen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"width\":1267,\"height\":1517,\"caption\":\"Khanh Nguyen\"},\"logo\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\"},\"description\":\"I love Java and everything related to Java.\",\"sameAs\":[\"https:\\\/\\\/huongdanjava.com\",\"https:\\\/\\\/www.facebook.com\\\/nhkhanh2406\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/KhanhNguyenJ\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction to gRPC - Huong Dan Java","description":"In this tutorial, I introduce you to the gRPC, some basic knowledge, and an example of implementing a gRPC server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/huongdanjava.com\/introduction-to-grpc.html","og_locale":"en_US","og_type":"article","og_title":"Introduction to gRPC - Huong Dan Java","og_description":"In this tutorial, I introduce you to the gRPC, some basic knowledge, and an example of implementing a gRPC server.","og_url":"https:\/\/huongdanjava.com\/introduction-to-grpc.html","og_site_name":"Huong Dan Java","article_publisher":"https:\/\/www.facebook.com\/nhkhanh2406","article_author":"https:\/\/www.facebook.com\/nhkhanh2406","article_published_time":"2024-09-07T09:10:55+00:00","article_modified_time":"2025-07-16T04:03:08+00:00","og_image":[{"width":880,"height":704,"url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/08\/grpc.jpg","type":"image\/jpeg"}],"author":"Khanh Nguyen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/KhanhNguyenJ","twitter_site":"@KhanhNguyenJ","twitter_misc":{"Written by":"Khanh Nguyen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#article","isPartOf":{"@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html"},"author":{"name":"Khanh Nguyen","@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"headline":"Introduction to gRPC","datePublished":"2024-09-07T09:10:55+00:00","dateModified":"2025-07-16T04:03:08+00:00","mainEntityOfPage":{"@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html"},"wordCount":707,"commentCount":0,"publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"image":{"@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/08\/grpc.jpg","articleSection":["gRPC"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/huongdanjava.com\/introduction-to-grpc.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html","url":"https:\/\/huongdanjava.com\/introduction-to-grpc.html","name":"Introduction to gRPC - Huong Dan Java","isPartOf":{"@id":"https:\/\/huongdanjava.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#primaryimage"},"image":{"@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/08\/grpc.jpg","datePublished":"2024-09-07T09:10:55+00:00","dateModified":"2025-07-16T04:03:08+00:00","description":"In this tutorial, I introduce you to the gRPC, some basic knowledge, and an example of implementing a gRPC server.","breadcrumb":{"@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/huongdanjava.com\/introduction-to-grpc.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#primaryimage","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/08\/grpc.jpg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2024\/08\/grpc.jpg","width":880,"height":704},{"@type":"BreadcrumbList","@id":"https:\/\/huongdanjava.com\/introduction-to-grpc.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/huongdanjava.com\/"},{"@type":"ListItem","position":2,"name":"Introduction to gRPC"}]},{"@type":"WebSite","@id":"https:\/\/huongdanjava.com\/#website","url":"https:\/\/huongdanjava.com\/","name":"Huong Dan Java","description":"Java development tutorials","publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/huongdanjava.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d","name":"Khanh Nguyen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","width":1267,"height":1517,"caption":"Khanh Nguyen"},"logo":{"@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg"},"description":"I love Java and everything related to Java.","sameAs":["https:\/\/huongdanjava.com","https:\/\/www.facebook.com\/nhkhanh2406","https:\/\/x.com\/https:\/\/twitter.com\/KhanhNguyenJ"]}]}},"_links":{"self":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/23237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/comments?post=23237"}],"version-history":[{"count":4,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/23237\/revisions"}],"predecessor-version":[{"id":24323,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/23237\/revisions\/24323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media\/23196"}],"wp:attachment":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media?parent=23237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/categories?post=23237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/tags?post=23237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}