{"id":83871,"date":"2018-11-26T07:00:02","date_gmt":"2018-11-26T05:00:02","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=83871"},"modified":"2018-11-25T13:53:03","modified_gmt":"2018-11-25T11:53:03","slug":"spring-microservices-docker-kubernetes-2","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html","title":{"rendered":"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2"},"content":{"rendered":"<p>In the <a href=\"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes.html\" target=\"_blank\" rel=\"noopener\">previous<\/a>\u00a0post we created our first micro service \u201cProductService\u201d using SpringBoot and Docker. In this part we will go into details of how to manage multiple microservices using Spring Cloud, netflix libraries, API gateways .<\/p>\n<p>For our order management system, let\u2019s say,\u00a0 a minimal relationship could be something like this :<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/new-doc-2018-11-22-15-35-06-e1542861482130.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-83883 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/new-doc-2018-11-22-15-35-06-e1542861482130.jpg\" alt=\"Kubernetes workshop\" width=\"809\" height=\"191\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/new-doc-2018-11-22-15-35-06-e1542861482130.jpg 809w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/new-doc-2018-11-22-15-35-06-e1542861482130-300x71.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/new-doc-2018-11-22-15-35-06-e1542861482130-768x181.jpg 768w\" sizes=\"(max-width: 809px) 100vw, 809px\" \/><\/a><\/p>\n<p>So, let\u2019s build 2 more services called \u201corderService\u201d and \u201ccustomerService\u201d in the similar manner how we build the \u201cproductService\u201d.<\/p>\n<p><strong>OrderService\u00a0<\/strong><\/p>\n<p>To create an order, we could pass customerId, a list of items with productIds and quantity. Lets see how to do that :<\/p>\n<pre class=\"brush:java\">@PostMapping(\"\/orders\")\r\n    public Order save(@RequestBody CustomerOrderRequest request) {\r\n        return orderRepository.save(Order\r\n                .builder()\r\n                .customerId(request.getCustomerId())\r\n                .externalReference(request.getExternalReference())\r\n                .items(toItems(request.getItems())).build());\r\n    }\r\n\r\n    private List toItems(List items) {\r\n        return items.stream().map(item -&gt; Item.builder().productId(item.getProductId())\r\n                .quantity(item.getQuantity()).build()).collect(Collectors.toList());\r\n    }<\/pre>\n<p>Here, we are saving customerId, list of items with productIds into the database.<\/p>\n<p>For fetching the complete order Details we would need the complete customer object and the product details. The result would look something like this :<\/p>\n<pre class=\"brush:js\">{\r\n\t\"orderId\": \"1234\",\r\n\t\"externalReference\": \"234257hf\",\r\n\t\"customer\": {\r\n\t\t\"id\": 123,\r\n\t\t\"firstName\": \"anirudh\",\r\n\t\t\"lastName\": \"bhatnagar\",\r\n\t\t\"phone\": \"21323\",\r\n\t\t\"email\": \"test@test.com\",\r\n\t\t\"address\": {\r\n\t\t\t\"addressLine1\": \"123\",\r\n\t\t\t\"addressLine2\": \"pwe\",\r\n\t\t\t\"city\": \"Syd\",\r\n\t\t\t\"state\": \"NSW\",\r\n\t\t\t\"country\": \"Aus\",\r\n\t\t\t\"postcode\": 2000\r\n\t\t}\r\n\t},\r\n\t\"createdDate\": \"2018-11-12\",\r\n\t\"items\": [{\r\n\t\t\"product\": {\r\n\t\t\t\"id\": 123,\r\n\t\t\t\"name\": \"Nike Shoes\",\r\n\t\t\t\"description\": \"Mens shoes\",\r\n\t\t\t\"price\": \"100\",\r\n\t\t\t\"sku\": \"1234\"\r\n\t\t},\r\n\t\t\"quantity\": 3\r\n\t}],\r\n\t\"totalOrderCost\": \"300.00\",\r\n\t\"totalOrderTax\": \"30.00\"\r\n}<\/pre>\n<p>The detailed order response should contain details of customer, address, product and total cost of the order. In order to fetch this information, the order service would need to fetch details from product service and customer service.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><strong>Fetching Product details from ProductService in Order Service<\/strong><br \/>\nIn order to fetch product service details in order Service, we would need a running product service, and a client in orderController to make a http GET call to ProductService. For the httpClient we would use <a href=\"https:\/\/github.com\/OpenFeign\/feign\">OpenFeign<\/a> a client library by Netflix, this is available as part of spring-cloud starter.So lets add that dependency in our build.gradle file :<\/p>\n<pre class=\"brush:bash\">implementation('org.springframework.cloud:spring-cloud-starter-openfeign')\r\ndependencyManagement {\r\n\timports {\r\n\t\tmavenBom \"org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}\"\r\n\t}\r\n}<\/pre>\n<p>Now that we have added the dependency, we would be making a proxy interface called \u201cProductServiceProxy\u201d to this service using @FeignClient :<\/p>\n<pre class=\"brush:java\">@FeignClient(name = \"product-service\", url = \"localhost:8001\")\r\npublic interface ProductServiceProxy {\r\n\r\n    @GetMapping(\"\/products\/{id}\")\r\n    Product getProduct(@PathVariable(\"id\") Long id);\r\n}<\/pre>\n<p>We\u2019ve added the annotation @FeignClient to the interface and configured the name and url of the product service.<br \/>\nWe need to also enable Feign client for our application by adding another annotation in our main class:<\/p>\n<pre class=\"brush:java\">@SpringBootApplication\r\n@EnableFeignClients\r\npublic class OrderServiceApplication {\r\n......<\/pre>\n<p>Finally, we need to make the call to product service running at localhost port 8001 to fetch product details using product id provided in order and populate the order details response object :<\/p>\n<pre class=\"brush:java\">@GetMapping(\"\/orders\/{id}\")\r\n    public CustomerOrderDetails getOrders(@PathVariable(\"id\") Long orderId) {\r\n        final Order order = orderRepository.findById(orderId).orElse(null);\r\n        if (order == null) {\r\n            return null;\r\n        }\r\n        return toCustomerOrderDetails(order);\r\n    }\r\n\r\n    private CustomerOrderDetails toCustomerOrderDetails(Order order) {\r\n        return CustomerOrderDetails.builder()\r\n                .orderId(order.getId())\r\n                .createdDate(order.getCreatedDate())\r\n                .externalReference(order.getExternalReference())\r\n                .items(toItemList(order.getItems()))\r\n                .build();\r\n    }\r\n    \r\n    private List&lt;com.anirudhbhatnagar.orderService.dto.product.Item&gt; toItemList(List&lt;Item&gt; items) {\r\n        return items.stream().map(item -&gt; toItemDto(item)).collect(Collectors.toList());\r\n    }\r\n\r\n    private com.anirudhbhatnagar.orderService.dto.product.Item toItemDto(Item item) {\r\n        return com.anirudhbhatnagar.orderService.dto.product.Item\r\n                .builder()\r\n                .product(productServiceProxy.getProduct(item.getProductId())).build();\r\n    }<\/pre>\n<p>If you look at the above code carefully,<\/p>\n<pre class=\"brush:bash\">productServiceProxy.getProduct(item.getProductId())<\/pre>\n<p>you will see that, once we get request to fetch order details for a give orderId, we first get the order data saved in order service database and then using the productIds provided in each item or the order, we make a call to productService and populate a orderDetails response object.<\/p>\n<p><strong>Test it<\/strong><br \/>\nOnce the orderService is up and running on port 8002 and productService is running at port 8001. We can test our application: Make sure there are some products created using product service, as described in previous <a href=\"https:\/\/anirudhbhatnagar.com\/2018\/11\/17\/spring-boot-microservices-docker-and-kubernetes-workshop-part1\/\" target=\"_blank\" rel=\"noopener\">blog<\/a>.<br \/>\nNote down the productId which you created in your product service and lets create a new order using the same : Do a POST on <a href=\"http:\/\/localhost:8002\/orders\" rel=\"nofollow\">http:\/\/localhost:8002\/orders<\/a> using postman, with the request as given below :<\/p>\n<pre class=\"brush:js\">{\r\n\"customerId\" : \"123\",\r\n\"externalReference\" : \"1234567\",\r\n\"items\" : [{\r\n\t\"productId\" : 1,\r\n\t\"quantity\" : 2\r\n}]\r\n}<\/pre>\n<p>This will create a new order, not down the response to find the order Id. Now lets fetch the order details using this order Id : Do a GET on <a href=\"http:\/\/localhost\/8002\/orders\/\" rel=\"nofollow\">http:\/\/localhost\/8002\/orders\/<\/a>{order-id}, this should return you the following response :<\/p>\n<pre class=\"brush:js\">{\r\n    \"orderId\": 12,\r\n    \"externalReference\": \"1234567\",\r\n    \"customer\": null,\r\n    \"createdDate\": null,\r\n    \"items\": [\r\n        {\r\n            \"product\": {\r\n                \"id\": \"1\",\r\n                \"name\": \"Nike\",\r\n                \"description\": \"Shoes\",\r\n                \"price\": \"100\",\r\n                \"sku\": \"1234\"\r\n            },\r\n            \"quantity\": 2\r\n        }\r\n    ],\r\n    \"totalOrderCost\": \"200\"\r\n}<\/pre>\n<p>So, here we saw how order service made a request to product service and populated the response object. However, we still see customer as \u201cnull\u201d, So in order to populate the customer details, we would need fetch it from Customer Service. In order to set up Customer Service we would do the following :<br \/>\n1. Set up Customer Service in similar way how we did for product or order service using Spring initializer.<br \/>\n2. Set up Proxy client Service in OrderService<br \/>\n3. Call CustomerService from Order Controller to populate customer details inside the Order Details response object.<br \/>\nIf everything is working fine, we should see the customer details as well.<\/p>\n<p>Currently, we have hardcoded the URLs of the services in order service, but ideally they would need to be dynamically discovered. So, in the next section, we will add \u201cService Discovery\u201d and \u201cload balancing\u201d to our 3 microservices.<\/p>\n<p>The entire source code can be referenced <a href=\"https:\/\/github.com\/anirudh83\/orderService\">here<\/a>.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Java Code Geeks with permission by Anirudh Bhatnagar, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"https:\/\/anirudhbhatnagar.com\/2018\/11\/23\/spring-boot-microservices-docker-and-kubernetes-workshop-part2\/\" target=\"_blank\" rel=\"noopener\">Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the previous\u00a0post we created our first micro service \u201cProductService\u201d using SpringBoot and Docker. In this part we will go into details of how to manage multiple microservices using Spring Cloud, netflix libraries, API gateways . For our order management system, let\u2019s say,\u00a0 a minimal relationship could be something like this : So, let\u2019s build &hellip;<\/p>\n","protected":false},"author":503,"featured_media":24013,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[936,1064,960,854],"class_list":["post-83871","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-docker","tag-kubernetes","tag-microservices","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2 - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about Kubernetes workshop? Check our article explaining how to manage multiple microservices using Spring Cloud, netflix libraries,..\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2 - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about Kubernetes workshop? Check our article explaining how to manage multiple microservices using Spring Cloud, netflix libraries,..\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-26T05:00:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Anirudh Bhatnagar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/anirudh_bh\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anirudh Bhatnagar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html\"},\"author\":{\"name\":\"Anirudh Bhatnagar\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/12f4f6d257ae9642dcccf1e58bab8346\"},\"headline\":\"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2\",\"datePublished\":\"2018-11-26T05:00:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html\"},\"wordCount\":693,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"keywords\":[\"Docker\",\"Kubernetes\",\"Microservices\",\"Spring Boot\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html\",\"name\":\"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2 - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"datePublished\":\"2018-11-26T05:00:02+00:00\",\"description\":\"Interested to learn about Kubernetes workshop? Check our article explaining how to manage multiple microservices using Spring Cloud, netflix libraries,..\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/04\\\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/11\\\/spring-microservices-docker-kubernetes-2.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/12f4f6d257ae9642dcccf1e58bab8346\",\"name\":\"Anirudh Bhatnagar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b90deb868665958c0c6608c42166b0318f8beb8743e356e8073f24723b0f28aa?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b90deb868665958c0c6608c42166b0318f8beb8743e356e8073f24723b0f28aa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b90deb868665958c0c6608c42166b0318f8beb8743e356e8073f24723b0f28aa?s=96&d=mm&r=g\",\"caption\":\"Anirudh Bhatnagar\"},\"description\":\"Anirudh is a Java programmer with extensive experience in building Java\\\/J2EE applications. He has always been fascinated by the new technologies and emerging trends in software development. He has been involved in propagating these changes and new technologies in his projects. He is an avid blogger and agile enthusiast who believes in writing clean and well tested code.\",\"sameAs\":[\"http:\\\/\\\/anirudhbhatnagar.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/anirudhbhatnagar\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/anirudh_bh\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/anirudh-bhatnagar\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2 - Java Code Geeks","description":"Interested to learn about Kubernetes workshop? Check our article explaining how to manage multiple microservices using Spring Cloud, netflix libraries,..","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:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html","og_locale":"en_US","og_type":"article","og_title":"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2 - Java Code Geeks","og_description":"Interested to learn about Kubernetes workshop? Check our article explaining how to manage multiple microservices using Spring Cloud, netflix libraries,..","og_url":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-11-26T05:00:02+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Anirudh Bhatnagar","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/anirudh_bh","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Anirudh Bhatnagar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html"},"author":{"name":"Anirudh Bhatnagar","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/12f4f6d257ae9642dcccf1e58bab8346"},"headline":"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2","datePublished":"2018-11-26T05:00:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html"},"wordCount":693,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","keywords":["Docker","Kubernetes","Microservices","Spring Boot"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html","url":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html","name":"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2 - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","datePublished":"2018-11-26T05:00:02+00:00","description":"Interested to learn about Kubernetes workshop? Check our article explaining how to manage multiple microservices using Spring Cloud, netflix libraries,..","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/04\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2018\/11\/spring-microservices-docker-kubernetes-2.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring Boot Microservices , Docker and Kubernetes workshop \u2013 part2"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/12f4f6d257ae9642dcccf1e58bab8346","name":"Anirudh Bhatnagar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b90deb868665958c0c6608c42166b0318f8beb8743e356e8073f24723b0f28aa?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b90deb868665958c0c6608c42166b0318f8beb8743e356e8073f24723b0f28aa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b90deb868665958c0c6608c42166b0318f8beb8743e356e8073f24723b0f28aa?s=96&d=mm&r=g","caption":"Anirudh Bhatnagar"},"description":"Anirudh is a Java programmer with extensive experience in building Java\/J2EE applications. He has always been fascinated by the new technologies and emerging trends in software development. He has been involved in propagating these changes and new technologies in his projects. He is an avid blogger and agile enthusiast who believes in writing clean and well tested code.","sameAs":["http:\/\/anirudhbhatnagar.com\/","http:\/\/www.linkedin.com\/in\/anirudhbhatnagar\/","https:\/\/x.com\/https:\/\/twitter.com\/anirudh_bh"],"url":"https:\/\/www.javacodegeeks.com\/author\/anirudh-bhatnagar"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/83871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/503"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=83871"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/83871\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/24013"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=83871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=83871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=83871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}