{"id":204,"date":"2020-04-11T02:04:14","date_gmt":"2020-04-11T02:04:14","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/microservices\/?p=204"},"modified":"2020-12-16T11:20:23","modified_gmt":"2020-12-16T11:20:23","slug":"complete-cqrs-application-with-axon-framework-3-build-the-ui","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/microservices\/complete-cqrs-application-with-axon-framework-3-build-the-ui\/","title":{"rendered":"Complete CQRS Application with Axon Framework \u2013 3 (Build the UI)"},"content":{"rendered":"<p>This is Part 3 and the final part of our CQRS Application.<\/p>\n<p>Here is <a href=\"https:\/\/www.kindsonthegenius.com\/microservices\/complete-cqrs-application-with-axon-framework-1-step-by-step-guide\/\">Part 1<\/a> and <a href=\"https:\/\/www.kindsonthegenius.com\/microservices\/complete-cqrs-application-with-axon-framework-2-step-by-step-guide\/\" target=\"_blank\" rel=\"noopener noreferrer\">Part 2<\/a>.<\/p>\n<p>In this part, we would build the GUI and learn the following:<\/p>\n<ul>\n<li>Building a GUI Using Bootstrap\/JQuery\/JavaScript<\/li>\n<li>How Thymeleaf works<\/li>\n<li>Making REST API call using RestTemplate<\/li>\n<\/ul>\n<p>So, let&#8217;s get started!<\/p>\n<ol>\n<li><a href=\"#t1\">Add the JQuery and a Bootstrap Dependencies<\/a><\/li>\n<li><a href=\"#t2\">Build the HTML Page<\/a><\/li>\n<li><a href=\"#t3\">Create the JavaScript<\/a><\/li>\n<li><a href=\"#t4\">Setup the Controller file<\/a><\/li>\n<li><a href=\"#t5\">Troubleshooting Possible Errors<\/a><\/li>\n<li><a href=\"#vid\">Watch the Video<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t1\">1. Add the JQuery and Bootstrap Dependencies<\/strong><\/h5>\n<p>It&#8217;s easier to just add the JQuery and Bootstrap dependencies in your pom.xml. In this way you have all the necessary scripts and stylesheets added to your classpath.<\/p>\n<p>See the dependencies below. You can also get them from <a href=\"https:\/\/mvnrepository.com\/\">Maven Repository<\/a><\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\r\n\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.webjars<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\r\n\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>bootstrap<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\r\n\t<span style=\"color: #007700;\">&lt;version&gt;<\/span>4.3.1<span style=\"color: #007700;\">&lt;\/version&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\r\n\r\n<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\r\n\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.webjars<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\r\n\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>jquery<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\r\n\t<span style=\"color: #007700;\">&lt;version&gt;<\/span>3.4.1<span style=\"color: #007700;\">&lt;\/version&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t2\">2. Create the HTML Page<\/strong><\/h5>\n<p>You need to create the index.html page inside the src\/main\/resources\/templates folder. You can find all the files in my <a href=\"https:\/\/github.com\/KindsonTheGenius\">Github repository here<\/a>.<\/p>\n<p>The html page would have to produce this output shown below:<br \/>\n<a href=\"https:\/\/www.kindsonthegenius.com\/microservices\/complete-cqrs-application-with-axon-framework-3-build-the-ui\/html-page-output\/#main\" rel=\"attachment wp-att-205\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-205 \" src=\"https:\/\/www.kindsonthegenius.com\/microservices\/wp-content\/uploads\/sites\/18\/2020\/04\/Html-Page-Output.jpg\" alt=\"\" width=\"529\" height=\"309\" srcset=\"https:\/\/www.kindsonthegenius.com\/microservices\/wp-content\/uploads\/sites\/18\/2020\/04\/Html-Page-Output.jpg 954w, https:\/\/www.kindsonthegenius.com\/microservices\/wp-content\/uploads\/sites\/18\/2020\/04\/Html-Page-Output-300x175.jpg 300w, https:\/\/www.kindsonthegenius.com\/microservices\/wp-content\/uploads\/sites\/18\/2020\/04\/Html-Page-Output-768x448.jpg 768w\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" \/><\/a><\/p>\n<p>I would not put the code for this page here. You can get it from Github. However, you can see below the code for the &#8216;Order One Now&#8217; button.<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;a<\/span> <span style=\"color: #0000cc;\">id=<\/span><span style=\"background-color: #fff0f0;\">\"orderButton\"<\/span> \r\n   <span style=\"color: #0000cc;\">th:href=<\/span><span style=\"background-color: #fff0f0;\">\"@{\/newOrder\/(id=${product.id},price=${product.price})}\"<\/span> \r\n   <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"btn btn-warning\"<\/span> <span style=\"color: #007700;\">&gt;<\/span>\r\n    Order One Now!\r\n<span style=\"color: #007700;\">&lt;\/a&gt;\r\n<\/span>\r\n<\/pre>\n<p>Notice in the code the <strong>th:href<\/strong> attribute. The th: prefix is added so the thymeleaf engine can interpret it. Also note that two parameters are passed along with the url string: the product price and product id.<\/p>\n<p>Another thing to note is how to include jquery and bootstrap links. See below<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;link<\/span> <span style=\"color: #0000cc;\">href=<\/span><span style=\"background-color: #fff0f0;\">\"\/webjars\/bootstrap\/4.3.1\/css\/bootstrap.css\"<\/span> <span style=\"color: #0000cc;\">rel=<\/span><span style=\"background-color: #fff0f0;\">\"stylesheet\"<\/span> <span style=\"color: #007700;\">\/&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;script <\/span><span style=\"color: #0000cc;\">type=<\/span><span style=\"background-color: #fff0f0;\">\"text\/javascript\"<\/span> <span style=\"color: #0000cc;\">src=<\/span><span style=\"background-color: #fff0f0;\">\"\/webjars\/jquery\/3.4.1\/jquery.min.js\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/script&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;script <\/span><span style=\"color: #0000cc;\">type=<\/span><span style=\"background-color: #fff0f0;\">\"text\/javascript\"<\/span> <span style=\"color: #0000cc;\">src=<\/span><span style=\"background-color: #fff0f0;\">\"\/webjars\/bootstrap\/4.3.1\/js\/bootstrap.min.js\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/script&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;script <\/span><span style=\"color: #0000cc;\">type=<\/span><span style=\"background-color: #fff0f0;\">\"text\/javascript\"<\/span> <span style=\"color: #0000cc;\">src=<\/span><span style=\"background-color: #fff0f0;\">\"..\/static\/main.js\"<\/span> <span style=\"color: #0000cc;\">th:src=<\/span><span style=\"background-color: #fff0f0;\">\"@{\/js\/main.js}\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/script&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>About the Modal<\/strong> &#8211; when you copy the code for the modal from the <a href=\"https:\/\/getbootstrap.com\/docs\/4.0\/components\/modal\/\" target=\"_blank\" rel=\"noopener noreferrer\">bootstrap site<\/a> to the index page, you need to do two things:<\/p>\n<ul>\n<li>and an id of\u00a0 orderModal to the modal<\/li>\n<li>add an id of orderRef tot he primary button<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t3\">3. Create the JavaScript file<\/strong><\/h5>\n<p>I call this file main.js. This file is responsible for loading the modal confirm order. This file is placed inside the static folder<\/p>\n<p>So the user can confirm the order. The content of the main.js file is shown below:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">$(<span style=\"background-color: #fff0f0;\">'document'<\/span>).ready(<span style=\"color: #008800; font-weight: bold;\">function<\/span>(){\r\n    <span style=\"color: #888888;\">\/\/When the user clicks on the Order button<\/span>\r\n    $(<span style=\"background-color: #fff0f0;\">'.table #orderButton'<\/span>).on(<span style=\"background-color: #fff0f0;\">'click'<\/span>, <span style=\"color: #008800; font-weight: bold;\">function<\/span>(event){\r\n        event.preventDefault(); <span style=\"color: #888888;\">\/\/don't redirect<\/span>\r\n        <span style=\"color: #008800; font-weight: bold;\">var<\/span> href <span style=\"color: #333333;\">=<\/span> $(<span style=\"color: #008800; font-weight: bold;\">this<\/span>).attr(<span style=\"background-color: #fff0f0;\">'href'<\/span>); <span style=\"color: #888888;\">\/\/get the url of the button<\/span>\r\n        $(<span style=\"background-color: #fff0f0;\">'#orderModal #orderRef'<\/span>).attr(<span style=\"background-color: #fff0f0;\">'href'<\/span>, href); <span style=\"color: #888888;\">\/\/assign to OrderRef<\/span>\r\n        $(<span style=\"background-color: #fff0f0;\">'#orderModal'<\/span>).modal(); <span style=\"color: #888888;\">\/\/Display the modal<\/span>\r\n    });\r\n});\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>I have added the comments to the file to explain it. But it&#8217;s better you watch the video for a clearer understanding. Note that orderRef is the id of the button in the modal while orderModal is the id of the modal.<\/p>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t4\">4. The Controller File<\/strong><\/h5>\n<p>When the user interacts with the form, the request is not sent to the RestController we build in <a href=\"https:\/\/www.kindsonthegenius.com\/microservices\/complete-cqrs-application-with-axon-framework-2-step-by-step-guide\/\">Part 2<\/a>. Rather, the request goes to a controller(not Rest!). This controller, then uses RestTemplate to make REST calls to the RestController. Makes sense! Good!<\/p>\n<p>Now you need to create a new file in the controllers package. I call this file HomeController. The content of this file is very important to note. This is because, you can see how to make both GET and POST request using RestTemplate.<\/p>\n<p>Here is the <em><strong>home()<\/strong><\/em> function. This function retrieves a list of order and products and send them as model attributes to the html page.<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@GetMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/index\"<\/span><span style=\"color: #333333;\">)<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span>  String <span style=\"color: #0066bb; font-weight: bold;\">home<\/span><span style=\"color: #333333;\">(<\/span>Model model<span style=\"color: #333333;\">){<\/span>\r\n    String productUrl <span style=\"color: #333333;\">=<\/span> <span style=\"background-color: #fff0f0;\">\"http:\/\/localhost:8081\/products\"<\/span><span style=\"color: #333333;\">;<\/span>\r\n    String orderUrl <span style=\"color: #333333;\">=<\/span> <span style=\"background-color: #fff0f0;\">\"http:\/\/localhost:8081\/orders\"<\/span><span style=\"color: #333333;\">;<\/span>\r\n    Object<span style=\"color: #333333;\">[]<\/span> objects <span style=\"color: #333333;\">=<\/span> restTemplate<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getForObject<\/span><span style=\"color: #333333;\">(<\/span>productUrl<span style=\"color: #333333;\">,<\/span> Object<span style=\"color: #333333;\">[].<\/span><span style=\"color: #0000cc;\">class<\/span><span style=\"color: #333333;\">);<\/span>\r\n    List<span style=\"color: #333333;\">&lt;<\/span>Object<span style=\"color: #333333;\">&gt;<\/span> products <span style=\"color: #333333;\">=<\/span> Arrays<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">asList<\/span><span style=\"color: #333333;\">(<\/span>objects<span style=\"color: #333333;\">);<\/span>\r\n    List<span style=\"color: #333333;\">&lt;<\/span>Object<span style=\"color: #333333;\">&gt;<\/span> orders <span style=\"color: #333333;\">=<\/span> Arrays<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">asList<\/span><span style=\"color: #333333;\">(<\/span>restTemplate<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getForObject<\/span><span style=\"color: #333333;\">(<\/span>orderUrl<span style=\"color: #333333;\">,<\/span> Object<span style=\"color: #333333;\">[].<\/span><span style=\"color: #0000cc;\">class<\/span><span style=\"color: #333333;\">));<\/span>\r\n    model<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">addAttribute<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"products\"<\/span><span style=\"color: #333333;\">,<\/span> products<span style=\"color: #333333;\">);<\/span>\r\n    model<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">addAttribute<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"orders\"<\/span><span style=\"color: #333333;\">,<\/span> orders<span style=\"color: #333333;\">);<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"background-color: #fff0f0;\">\"index\"<\/span><span style=\"color: #333333;\">;<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Here is the <em><strong>createOrder()<\/strong> <\/em>function. This function makes a post request to the RestController to create a new Order<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span>value<span style=\"color: #333333;\">=<\/span><span style=\"background-color: #fff0f0;\">\"\/newOrder\"<\/span><span style=\"color: #333333;\">,<\/span> method <span style=\"color: #333333;\">=<\/span> <span style=\"color: #333333;\">{<\/span>RequestMethod<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">POST<\/span><span style=\"color: #333333;\">,<\/span> RequestMethod<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">GET<\/span><span style=\"color: #333333;\">})<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> String <span style=\"color: #0066bb; font-weight: bold;\">createOrder<\/span><span style=\"color: #333333;\">(<\/span>String id<span style=\"color: #333333;\">,<\/span> String price<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n    String url <span style=\"color: #333333;\">=<\/span> <span style=\"background-color: #fff0f0;\">\"http:\/\/localhost:8081\/createOrder\"<\/span><span style=\"color: #333333;\">;<\/span>\r\n    HttpHeaders headers <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> HttpHeaders<span style=\"color: #333333;\">();<\/span>\r\n    headers<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">setContentType<\/span><span style=\"color: #333333;\">(<\/span>MediaType<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">APPLICATION_FORM_URLENCODED<\/span><span style=\"color: #333333;\">);<\/span>\r\n    MultiValueMap<span style=\"color: #333333;\">&lt;<\/span>String<span style=\"color: #333333;\">,<\/span> String<span style=\"color: #333333;\">&gt;<\/span> map <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> LinkedMultiValueMap<span style=\"color: #333333;\">&lt;<\/span>String<span style=\"color: #333333;\">,<\/span> String<span style=\"color: #333333;\">&gt;();<\/span>\r\n    map<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"price\"<\/span><span style=\"color: #333333;\">,<\/span> price<span style=\"color: #333333;\">);<\/span>\r\n    map<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"number\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"1\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n    map<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"productid\"<\/span><span style=\"color: #333333;\">,<\/span> id<span style=\"color: #333333;\">);<\/span>\r\n    HttpEntity<span style=\"color: #333333;\">&lt;<\/span>MultiValueMap<span style=\"color: #333333;\">&lt;<\/span>String<span style=\"color: #333333;\">,<\/span> String<span style=\"color: #333333;\">&gt;&gt;<\/span> request <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> HttpEntity<span style=\"color: #333333;\">&lt;<\/span>MultiValueMap<span style=\"color: #333333;\">&lt;<\/span>String<span style=\"color: #333333;\">,<\/span> String<span style=\"color: #333333;\">&gt;&gt;(<\/span>map<span style=\"color: #333333;\">,<\/span> headers<span style=\"color: #333333;\">);<\/span>\r\n    restTemplate<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">postForEntity<\/span><span style=\"color: #333333;\">(<\/span>url<span style=\"color: #333333;\">,<\/span>request<span style=\"color: #333333;\">,<\/span> String<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">class<\/span><span style=\"color: #333333;\">);<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"background-color: #fff0f0;\">\"redirect:\/index\"<\/span><span style=\"color: #333333;\">;<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t5\">5. Possible Errors<\/strong><\/h4>\n<p>Now you can test the application. If you encounter errors, here are the troubleshooting steps:<\/p>\n<p>1. You may need to modify the createOrder() method in the orderController as follows:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@PostMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/createOrder\"<\/span><span style=\"color: #333333;\">)<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #333399; font-weight: bold;\">void<\/span> <span style=\"color: #0066bb; font-weight: bold;\">handle<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #555555; font-weight: bold;\">@RequestParam<\/span> MultiValueMap summary<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n    CreateOrderCommand cmd <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> CreateOrderCommand<span style=\"color: #333333;\">(<\/span>\r\n            UUID<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">randomUUID<\/span><span style=\"color: #333333;\">(),<\/span>\r\n            Double<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">valueOf<\/span><span style=\"color: #333333;\">(<\/span>summary<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getFirst<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"price\"<\/span><span style=\"color: #333333;\">).<\/span><span style=\"color: #0000cc;\">toString<\/span><span style=\"color: #333333;\">()),<\/span>\r\n            Integer<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">parseInt<\/span><span style=\"color: #333333;\">(<\/span>summary<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getFirst<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"number\"<\/span><span style=\"color: #333333;\">).<\/span><span style=\"color: #0000cc;\">toString<\/span><span style=\"color: #333333;\">()),<\/span>\r\n            summary<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getFirst<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"productid\"<\/span><span style=\"color: #333333;\">).<\/span><span style=\"color: #0000cc;\">toString<\/span><span style=\"color: #333333;\">()<\/span>\r\n    <span style=\"color: #333333;\">);<\/span>\r\n    commandGateway<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">sendAndWait<\/span><span style=\"color: #333333;\">(<\/span>cmd<span style=\"color: #333333;\">);<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>Note the @RequestParam annotation (not @RequestBody)<\/p>\n<p>2. In the createOrder method in the HomeController, ensure the the &#8220;productid&#8221; is added to the map, not &#8220;id&#8221;.<\/p>\n<p>3. For any other troubleshooting, you can see the video<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" id=\"vid\" src=\"https:\/\/www.youtube.com\/embed\/j5EjJH9zO0s\" width=\"100%\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is Part 3 and the final part of our CQRS Application. Here is Part 1 and Part 2. In this part, we would build &hellip; <\/p>\n","protected":false},"author":1,"featured_media":206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,27],"tags":[56],"class_list":["post-204","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-axon","category-axonframework","tag-resttemplate"],"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":9,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":368,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/posts\/204\/revisions\/368"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/media\/206"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/microservices\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}