<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>sczyh30&#39;s Metaspace</title>
  <subtitle>Follow my heart</subtitle>
  <link href="/en/atom.xml" rel="self"/>
  
  <link href="http://www.sczyh30.com/en/"/>
  <updated>2016-08-19T15:40:12.014Z</updated>
  <id>http://www.sczyh30.com/en/</id>
  
  <author>
    <name>Eric Zhao</name>
    
  </author>
  
  <generator uri="http://hexo.io/">Hexo</generator>
  
  <entry>
    <title>GSoC 2016 | Vert.x Blueprint Application</title>
    <link href="http://www.sczyh30.com/en/2016/08/19/gsoc-2016-final-evaluation/"/>
    <id>http://www.sczyh30.com/en/2016/08/19/gsoc-2016-final-evaluation/</id>
    <published>2016-08-18T16:00:00.000Z</published>
    <updated>2016-08-19T15:40:12.014Z</updated>
    
    <content type="html">&lt;p&gt;&lt;img src=&quot;https://developers.google.com/open-source/gsoc/resources/downloads/GSoC-icon-192.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This blog post is intended to be an illustration of my work for &lt;strong&gt;GSoC Final Evaluation&lt;/strong&gt;.&lt;/p&gt;
&lt;h1 id=&quot;Overview&quot;&gt;&lt;a href=&quot;#Overview&quot; class=&quot;headerlink&quot; title=&quot;Overview&quot;&gt;&lt;/a&gt;Overview&lt;/h1&gt;&lt;p&gt;Vert.x is a toolkit for the Java Virtual Machine enabling the implementation of reactive, highly concurrent, polyglot applications. The idea of the project is to implement a set of applications using the Vert.x toolkit to illustrate how different classes of applications can be done. This project aims to &lt;strong&gt;provide guidelines to Vert.x users to implement various applications&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The blueprint project contains three parts: &lt;strong&gt;Todo Backend&lt;/strong&gt;, &lt;strong&gt;Vert.x Kue&lt;/strong&gt; and &lt;strong&gt;Online Shopping Microservice&lt;/strong&gt;. Both runnable code and very detailed documents and tutorials (both in English and Chinese) are provided.&lt;/p&gt;
&lt;h1 id=&quot;Vert-x-Blueprint-Todo-Backend&quot;&gt;&lt;a href=&quot;#Vert-x-Blueprint-Todo-Backend&quot; class=&quot;headerlink&quot; title=&quot;Vert.x Blueprint - Todo Backend&quot;&gt;&lt;/a&gt;Vert.x Blueprint - Todo Backend&lt;/h1&gt;&lt;p&gt;The project &lt;strong&gt;repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-todo-backend&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;sczyh30/vertx-blueprint-todo-backend&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is a todo-backend implementation using Vert.x and various persistence (e.g. Redis or MySQL). It is intended to be an introduction to basic Vert.x web RESTful service development. From this blueprint, developers could learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What is Vert.x and its basic design&lt;/li&gt;
&lt;li&gt;What is and how to use &lt;code&gt;Verticle&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to develop a REST API using Vert.x Web&lt;/li&gt;
&lt;li&gt;How to make use of &lt;strong&gt;asynchronous development model&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Future-based reactive asynchronous pattern&lt;/li&gt;
&lt;li&gt;How to use persistence such as &lt;em&gt;Redis&lt;/em&gt; and &lt;em&gt;MySQL&lt;/em&gt; with the help of Vert.x data access components&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tutorial documents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-todo-backend/&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;The tutorial document (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-todo-backend/cn/&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;The tutorial document (Chinese)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-todo-backend/master/docs/img/vertx-todobackend-ui.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;Vert-x-Blueprint-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Vert-x-Blueprint-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Vert.x Blueprint - Vert.x Kue&quot;&gt;&lt;/a&gt;Vert.x Blueprint - Vert.x Kue&lt;/h1&gt;&lt;p&gt;The project &lt;strong&gt;repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is a priority job queue developed with Vert.x and backed by Redis. It’s a Vert.x implementation version of &lt;a href=&quot;https://github.com/Automattic/kue&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Automattic/kue&lt;/a&gt; that can be used in production.&lt;/p&gt;
&lt;p&gt;Feature document of Vert.x Kue is available here: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/blob/master/docs/en/vertx-kue-features-en.md&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Kue Features&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is intended to be an introduction to message-based application development using Vert.x. From this blueprint, developers could learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to make use of &lt;strong&gt;Vert.x Event Bus&lt;/strong&gt; (distributed)&lt;/li&gt;
&lt;li&gt;How to develop message based application with Vert.x&lt;/li&gt;
&lt;li&gt;Event pattern of event bus (Pub/sub, point to point)&lt;/li&gt;
&lt;li&gt;How to design clustered Vert.x applications&lt;/li&gt;
&lt;li&gt;How to design and implement a job queue&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;Vert.x Service Proxy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;More complicated practice about Vert.x Redis&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tutorial documents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/kue-core/index.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Kue Core Tutorial - English Version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/kue-http/index.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Kue Web Tutorial - English Version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/cn/kue-core/index.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Kue Core Tutorial - Chinese Version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/cn/kue-http/index.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Kue Web Tutorial - Chinese Version&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-job-queue/master/docs/images/vertx_kue_ui_1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;Vert-x-Blueprint-Online-Shopping-Microservice&quot;&gt;&lt;a href=&quot;#Vert-x-Blueprint-Online-Shopping-Microservice&quot; class=&quot;headerlink&quot; title=&quot;Vert.x Blueprint - Online Shopping Microservice&quot;&gt;&lt;/a&gt;Vert.x Blueprint - Online Shopping Microservice&lt;/h1&gt;&lt;p&gt;The project &lt;strong&gt;repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-microservice&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;sczyh30/vertx-blueprint-microservice&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is an online shopping microservice application developed with Vert.x. It is intended to be an illustration on how to develop microservice applications using Vert.x toolkit. From this blueprint, developers could learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microservice development with Vert.x&lt;/li&gt;
&lt;li&gt;Asynchronous development model&lt;/li&gt;
&lt;li&gt;Reactive and functional pattern&lt;/li&gt;
&lt;li&gt;Event sourcing pattern&lt;/li&gt;
&lt;li&gt;Asynchronous RPC on the clustered event bus&lt;/li&gt;
&lt;li&gt;Various type of services (e.g. HTTP endpoint, message source, event bus service)&lt;/li&gt;
&lt;li&gt;Vert.x Service Discovery&lt;/li&gt;
&lt;li&gt;Vert.x Circuit Breaker&lt;/li&gt;
&lt;li&gt;Microservice with polyglot persistence&lt;/li&gt;
&lt;li&gt;How to implement an API gateway&lt;/li&gt;
&lt;li&gt;Global authentication (OAuth 2 + Keycloak)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And many more things…&lt;/p&gt;
&lt;p&gt;The tutorial documents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/index.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Microservice Blueprint Tutorial - Development (English Version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/api-gateway.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Microservice Blueprint Tutorial - API Gateway (English Version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/cn/index.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Microservice Blueprint Tutorial - Development (Chinese Version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/cn/api-gateway.html&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Microservice Blueprint Tutorial - API Gateway (Chinese Version)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-microservice/master/docs/images/shopping-spa-index.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-microservice/master/docs/images/monitor-dashboard.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;Final-Summary-amp-amp-Future&quot;&gt;&lt;a href=&quot;#Final-Summary-amp-amp-Future&quot; class=&quot;headerlink&quot; title=&quot;Final Summary &amp;amp;&amp;amp; Future&quot;&gt;&lt;/a&gt;Final Summary &amp;amp;&amp;amp; Future&lt;/h1&gt;&lt;p&gt;I really enjoy the work! During the work period I’ve learned a lot about Vert.x, various asynchronous development model, distributed systems, microservice architecture and many more things… This motivates me to investigate new technologies, and the infrastructure of Vert.x. This would be an unforgettable experience.&lt;/p&gt;
&lt;p&gt;I’ll keep track of the blueprint project and planning to make some more improvements on the microservice blueprint to illustrate more usage about Vert.x and microservices (e.g. recommendation, Kafka, full-index search). And soon I’d like to contribute to &lt;strong&gt;Vert.x Microservice Toolbox&lt;/strong&gt; to add more features and integration with other technologies. As &lt;strong&gt;Vert.x Scala&lt;/strong&gt; is nearly technical preview, I’m also willing to contribute to Vert.x Scala version.&lt;/p&gt;
&lt;h1 id=&quot;Thanks&quot;&gt;&lt;a href=&quot;#Thanks&quot; class=&quot;headerlink&quot; title=&quot;Thanks&quot;&gt;&lt;/a&gt;Thanks&lt;/h1&gt;&lt;p&gt;I would like to give my sincere thanks to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My mentors, &lt;a href=&quot;https://github.com/pmlopes&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Paulo Lopes&lt;/a&gt; and &lt;a href=&quot;https://github.com/cescoffier&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Clement Escoffier&lt;/a&gt;. They provided me guidance and gave me a lot of help during the work :-)&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Vert.x Community&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The Google Summer of Code team, for this wonderful experience.&lt;/li&gt;
&lt;/ul&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;https://developers.google.com/open-source/gsoc/resources/downloads/GSoC-icon-192.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This blog post is intended to be an illustration of my work for &lt;strong&gt;GSoC Final Evaluation&lt;/strong&gt;.&lt;/p&gt;
&lt;h1 id=&quot;Overview&quot;&gt;&lt;a href=&quot;#Overview&quot; class=&quot;headerlink&quot; title=&quot;Overview&quot;&gt;&lt;/a&gt;Overview&lt;/h1&gt;&lt;p&gt;Vert.x is a toolkit for the Java Virtual Machine enabling the implementation of reactive, highly concurrent, polyglot applications. The idea of the project is to implement a set of applications using the Vert.x toolkit to illustrate how different classes of applications can be done. This project aims to &lt;strong&gt;provide guidelines to Vert.x users to implement various applications&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The blueprint project contains three parts: &lt;strong&gt;Todo Backend&lt;/strong&gt;, &lt;strong&gt;Vert.x Kue&lt;/strong&gt; and &lt;strong&gt;Online Shopping Microservice&lt;/strong&gt;. Both runnable code and very detailed documents and tutorials (both in English and Chinese) are provided.&lt;/p&gt;
&lt;h1 id=&quot;Vert-x-Blueprint-Todo-Backend&quot;&gt;&lt;a href=&quot;#Vert-x-Blueprint-Todo-Backend&quot; class=&quot;headerlink&quot; title=&quot;Vert.x Blueprint - Todo Backend&quot;&gt;&lt;/a&gt;Vert.x Blueprint - Todo Backend&lt;/h1&gt;&lt;p&gt;The project &lt;strong&gt;repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-todo-backend&quot;&gt;sczyh30/vertx-blueprint-todo-backend&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is a todo-backend implementation using Vert.x and various persistence (e.g. Redis or MySQL). It is intended to be an introduction to basic Vert.x web RESTful service development. From this blueprint, developers could learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What is Vert.x and its basic design&lt;/li&gt;
&lt;li&gt;What is and how to use &lt;code&gt;Verticle&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to develop a REST API using Vert.x Web&lt;/li&gt;
&lt;li&gt;How to make use of &lt;strong&gt;asynchronous development model&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Future-based reactive asynchronous pattern&lt;/li&gt;
&lt;li&gt;How to use persistence such as &lt;em&gt;Redis&lt;/em&gt; and &lt;em&gt;MySQL&lt;/em&gt; with the help of Vert.x data access components&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tutorial documents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-todo-backend/&quot;&gt;The tutorial document (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-todo-backend/cn/&quot;&gt;The tutorial document (Chinese)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-todo-backend/master/docs/img/vertx-todobackend-ui.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;Vert-x-Blueprint-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Vert-x-Blueprint-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Vert.x Blueprint - Vert.x Kue&quot;&gt;&lt;/a&gt;Vert.x Blueprint - Vert.x Kue&lt;/h1&gt;&lt;p&gt;The project &lt;strong&gt;repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is a priority job queue developed with Vert.x and backed by Redis. It’s a Vert.x implementation version of &lt;a href=&quot;https://github.com/Automattic/kue&quot;&gt;Automattic/kue&lt;/a&gt; that can be used in production.&lt;/p&gt;
&lt;p&gt;Feature document of Vert.x Kue is available here: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/blob/master/docs/en/vertx-kue-features-en.md&quot;&gt;Vert.x Kue Features&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is intended to be an introduction to message-based application development using Vert.x. From this blueprint, developers could learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to make use of &lt;strong&gt;Vert.x Event Bus&lt;/strong&gt; (distributed)&lt;/li&gt;
&lt;li&gt;How to develop message based application with Vert.x&lt;/li&gt;
&lt;li&gt;Event pattern of event bus (Pub/sub, point to point)&lt;/li&gt;
&lt;li&gt;How to design clustered Vert.x applications&lt;/li&gt;
&lt;li&gt;How to design and implement a job queue&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;Vert.x Service Proxy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;More complicated practice about Vert.x Redis&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tutorial documents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/kue-core/index.html&quot;&gt;Vert.x Kue Core Tutorial - English Version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/kue-http/index.html&quot;&gt;Vert.x Kue Web Tutorial - English Version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/cn/kue-core/index.html&quot;&gt;Vert.x Kue Core Tutorial - Chinese Version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-job-queue/cn/kue-http/index.html&quot;&gt;Vert.x Kue Web Tutorial - Chinese Version&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-job-queue/master/docs/images/vertx_kue_ui_1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;Vert-x-Blueprint-Online-Shopping-Microservice&quot;&gt;&lt;a href=&quot;#Vert-x-Blueprint-Online-Shopping-Microservice&quot; class=&quot;headerlink&quot; title=&quot;Vert.x Blueprint - Online Shopping Microservice&quot;&gt;&lt;/a&gt;Vert.x Blueprint - Online Shopping Microservice&lt;/h1&gt;&lt;p&gt;The project &lt;strong&gt;repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-microservice&quot;&gt;sczyh30/vertx-blueprint-microservice&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blueprint is an online shopping microservice application developed with Vert.x. It is intended to be an illustration on how to develop microservice applications using Vert.x toolkit. From this blueprint, developers could learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microservice development with Vert.x&lt;/li&gt;
&lt;li&gt;Asynchronous development model&lt;/li&gt;
&lt;li&gt;Reactive and functional pattern&lt;/li&gt;
&lt;li&gt;Event sourcing pattern&lt;/li&gt;
&lt;li&gt;Asynchronous RPC on the clustered event bus&lt;/li&gt;
&lt;li&gt;Various type of services (e.g. HTTP endpoint, message source, event bus service)&lt;/li&gt;
&lt;li&gt;Vert.x Service Discovery&lt;/li&gt;
&lt;li&gt;Vert.x Circuit Breaker&lt;/li&gt;
&lt;li&gt;Microservice with polyglot persistence&lt;/li&gt;
&lt;li&gt;How to implement an API gateway&lt;/li&gt;
&lt;li&gt;Global authentication (OAuth 2 + Keycloak)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And many more things…&lt;/p&gt;
&lt;p&gt;The tutorial documents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/index.html&quot;&gt;Vert.x Microservice Blueprint Tutorial - Development (English Version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/api-gateway.html&quot;&gt;Vert.x Microservice Blueprint Tutorial - API Gateway (English Version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/cn/index.html&quot;&gt;Vert.x Microservice Blueprint Tutorial - Development (Chinese Version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sczyh30.github.io/vertx-blueprint-microservice/cn/api-gateway.html&quot;&gt;Vert.x Microservice Blueprint Tutorial - API Gateway (Chinese Version)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-microservice/master/docs/images/shopping-spa-index.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-microservice/master/docs/images/monitor-dashboard.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;Final-Summary-amp-amp-Future&quot;&gt;&lt;a href=&quot;#Final-Summary-amp-amp-Future&quot; class=&quot;headerlink&quot; title=&quot;Final Summary &amp;amp;&amp;amp; Future&quot;&gt;&lt;/a&gt;Final Summary &amp;amp;&amp;amp; Future&lt;/h1&gt;&lt;p&gt;I really enjoy the work! During the work period I’ve learned a lot about Vert.x, various asynchronous development model, distributed systems, microservice architecture and many more things… This motivates me to investigate new technologies, and the infrastructure of Vert.x. This would be an unforgettable experience.&lt;/p&gt;
&lt;p&gt;I’ll keep track of the blueprint project and planning to make some more improvements on the microservice blueprint to illustrate more usage about Vert.x and microservices (e.g. recommendation, Kafka, full-index search). And soon I’d like to contribute to &lt;strong&gt;Vert.x Microservice Toolbox&lt;/strong&gt; to add more features and integration with other technologies. As &lt;strong&gt;Vert.x Scala&lt;/strong&gt; is nearly technical preview, I’m also willing to contribute to Vert.x Scala version.&lt;/p&gt;
&lt;h1 id=&quot;Thanks&quot;&gt;&lt;a href=&quot;#Thanks&quot; class=&quot;headerlink&quot; title=&quot;Thanks&quot;&gt;&lt;/a&gt;Thanks&lt;/h1&gt;&lt;p&gt;I would like to give my sincere thanks to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My mentors, &lt;a href=&quot;https://github.com/pmlopes&quot;&gt;Paulo Lopes&lt;/a&gt; and &lt;a href=&quot;https://github.com/cescoffier&quot;&gt;Clement Escoffier&lt;/a&gt;. They provided me guidance and gave me a lot of help during the work :-)&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Vert.x Community&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The Google Summer of Code team, for this wonderful experience.&lt;/li&gt;
&lt;/ul&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>Vert.x Microservice Blueprint | Some changes &amp;&amp; refactoring</title>
    <link href="http://www.sczyh30.com/en/2016/08/11/vertx-blueprint-microservice-design-refactor-01/"/>
    <id>http://www.sczyh30.com/en/2016/08/11/vertx-blueprint-microservice-design-refactor-01/</id>
    <published>2016-08-10T16:00:00.000Z</published>
    <updated>2016-08-19T15:54:56.601Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Simplified-architecture&quot;&gt;&lt;a href=&quot;#Simplified-architecture&quot; class=&quot;headerlink&quot; title=&quot;Simplified architecture&quot;&gt;&lt;/a&gt;Simplified architecture&lt;/h1&gt;&lt;p&gt;Some of the unecessary components has been removed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Payment Microservice: The logic should be refactored in order to fit for real production logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;New diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-microservice/initial-work/docs/images/entire-architecture.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;API-Gateway&quot;&gt;&lt;a href=&quot;#API-Gateway&quot; class=&quot;headerlink&quot; title=&quot;API Gateway&quot;&gt;&lt;/a&gt;API Gateway&lt;/h1&gt;&lt;p&gt;As suggested by Clement and Paulo, I use HTTP-HTTP pattern for API Gateway eventually. The API gateway itself is using HTTPS, but it communicates REST endpoints via HTTP.&lt;/p&gt;
&lt;p&gt;So the API Gateway is responsible for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dispatching requests to corresponding endpoint.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;How to implement this?&lt;br&gt;&lt;strong&gt;My solution&lt;/strong&gt;: When publishing endpoints to the service discovery infrasture, every endpoints must provide an &lt;code&gt;api-name&lt;/code&gt; to identify the api, then when a request arrives from the gateway, the gateway will get the prefix pattern &lt;code&gt;/api/:name/*&lt;/code&gt; and find any corresponding endpoints via discovery, then consume the HTTP endpoint.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Simple load balancing&lt;/li&gt;
&lt;li&gt;Health check&lt;/li&gt;
&lt;li&gt;Failure handling (using Vert.x Circuit Breaker)&lt;/li&gt;
&lt;li&gt;Global auth state storage(in route context and session scope)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Auth&quot;&gt;&lt;a href=&quot;#Auth&quot; class=&quot;headerlink&quot; title=&quot;Auth&quot;&gt;&lt;/a&gt;Auth&lt;/h1&gt;&lt;p&gt;It’s convenient to use Keycloak via Vert.x OAuth2.&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Simplified-architecture&quot;&gt;&lt;a href=&quot;#Simplified-architecture&quot; class=&quot;headerlink&quot; title=&quot;Simplified architecture&quot;&gt;&lt;/a&gt;Simplified architecture&lt;/h1&gt;&lt;p&gt;Some of the unecessary components has been removed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Payment Microservice: The logic should be refactored in order to fit for real production logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;New diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sczyh30/vertx-blueprint-microservice/initial-work/docs/images/entire-architecture.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;API-Gateway&quot;&gt;&lt;a href=&quot;#API-Gateway&quot; class=&quot;headerlink&quot; title=&quot;API Gateway&quot;&gt;&lt;/a&gt;API Gateway&lt;/h1&gt;&lt;p&gt;As suggested by Clement and Paulo, I use HTTP-HTTP pattern for API Gateway eventually. The API gateway itself is using HTTPS, but it communicates REST endpoints via HTTP.&lt;/p&gt;
&lt;p&gt;So the API Gateway is responsible for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dispatching requests to corresponding endpoint.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;How to implement this?&lt;br&gt;&lt;strong&gt;My solution&lt;/strong&gt;: When publishing endpoints to the service discovery infrasture, every endpoints must provide an &lt;code&gt;api-name&lt;/code&gt; to identify the api, then when a request arrives from the gateway, the gateway will get the prefix pattern &lt;code&gt;/api/:name/*&lt;/code&gt; and find any corresponding endpoints via discovery, then consume the HTTP endpoint.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Simple load balancing&lt;/li&gt;
&lt;li&gt;Health check&lt;/li&gt;
&lt;li&gt;Failure handling (using Vert.x Circuit Breaker)&lt;/li&gt;
&lt;li&gt;Global auth state storage(in route context and session scope)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Auth&quot;&gt;&lt;a href=&quot;#Auth&quot; class=&quot;headerlink&quot; title=&quot;Auth&quot;&gt;&lt;/a&gt;Auth&lt;/h1&gt;&lt;p&gt;It’s convenient to use Keycloak via Vert.x OAuth2.&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 11</title>
    <link href="http://www.sczyh30.com/en/2016/08/07/gsoc-work-period-week-11/"/>
    <id>http://www.sczyh30.com/en/2016/08/07/gsoc-work-period-week-11/</id>
    <published>2016-08-06T16:00:00.000Z</published>
    <updated>2016-08-19T15:54:08.533Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Architecture enhancement&lt;/li&gt;
&lt;li&gt;A simple SPA frontend for the microservice blueprint (use Vue.js)&lt;/li&gt;
&lt;li&gt;Monitor dashboard&lt;/li&gt;
&lt;li&gt;A simple recommendation component&lt;ul&gt;
&lt;li&gt;Maybe I should write a individual component providing Neo4j integration with Vert.x&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Run the application with Docker Compose&lt;/li&gt;
&lt;li&gt;Update tests&lt;/li&gt;
&lt;li&gt;Update documents and tutorials&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;Solved-Global-auth&quot;&gt;&lt;a href=&quot;#Solved-Global-auth&quot; class=&quot;headerlink&quot; title=&quot;Solved: Global auth&quot;&gt;&lt;/a&gt;Solved: Global auth&lt;/h2&gt;&lt;p&gt;How to manage global auth in a microservice application. For example, we login in from the login page and our login data is saved in the session. When we visit resources that are protected behind the auth, how we validate the user info (e.g. via session data or use SSO)?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solved:&lt;/strong&gt; Use OAuth 2 + Keycloak is a good point. The API gateway is responsible for storing authentication principal and validation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thought&lt;/strong&gt;: How to integrate well with SPA frontend?&lt;/p&gt;
&lt;h2 id=&quot;Solved-Need-a-better-mechanism-for-API-gateway&quot;&gt;&lt;a href=&quot;#Solved-Need-a-better-mechanism-for-API-gateway&quot; class=&quot;headerlink&quot; title=&quot;Solved: Need a better mechanism for API gateway&quot;&gt;&lt;/a&gt;Solved: Need a better mechanism for API gateway&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Solved:&lt;/strong&gt; use HTTP-HTTP pattern. The API Gateway is a individual verticle and is responsible for dispatching requests, managing global authentication, handling failure, health checking and simple load balancing. The API Gateway itself uses HTTPS, but it interacts with the downstream REST endpoints via HTTP.&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Refactored the architecture of the online shopping microservice, simplified some components (more features will be added into next version)&lt;/li&gt;
&lt;li&gt;Enhanced the logic of the entire online shopping process&lt;/li&gt;
&lt;li&gt;Code refinement and bug fixed&lt;/li&gt;
&lt;li&gt;Added some tests (some tests are in local and weren’t committed as it requires some local envs)&lt;/li&gt;
&lt;/ul&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Architecture enhancement&lt;/li&gt;
&lt;li&gt;A simple SPA frontend for the microservice blueprint (use Vue.js)&lt;/li&gt;
&lt;li&gt;Monitor dashboard&lt;/li&gt;
&lt;li&gt;A simple recommendation component&lt;ul&gt;
&lt;li&gt;Maybe I should write a individual component providing Neo4j integration with Vert.x&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Run the application with Docker Compose&lt;/li&gt;
&lt;li&gt;Update tests&lt;/li&gt;
&lt;li&gt;Update documents and tutorials&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;Solved-Global-auth&quot;&gt;&lt;a href=&quot;#Solved-Global-auth&quot; class=&quot;headerlink&quot; title=&quot;Solved: Global auth&quot;&gt;&lt;/a&gt;Solved: Global auth&lt;/h2&gt;&lt;p&gt;How to manage global auth in a microservice application. For example, we login in from the login page and our login data is saved in the session. When we visit resources that are protected behind the auth, how we validate the user info (e.g. via session data or use SSO)?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solved:&lt;/strong&gt; Use OAuth 2 + Keycloak is a good point. The API gateway is responsible for storing authentication principal and validation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thought&lt;/strong&gt;: How to integrate well with SPA frontend?&lt;/p&gt;
&lt;h2 id=&quot;Solved-Need-a-better-mechanism-for-API-gateway&quot;&gt;&lt;a href=&quot;#Solved-Need-a-better-mechanism-for-API-gateway&quot; class=&quot;headerlink&quot; title=&quot;Solved: Need a better mechanism for API gateway&quot;&gt;&lt;/a&gt;Solved: Need a better mechanism for API gateway&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Solved:&lt;/strong&gt; use HTTP-HTTP pattern. The API Gateway is a individual verticle and is responsible for dispatching requests, managing global authentication, handling failure, health checking and simple load balancing. The API Gateway itself uses HTTPS, but it interacts with the downstream REST endpoints via HTTP.&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Refactored the architecture of the online shopping microservice, simplified some components (more features will be added into next version)&lt;/li&gt;
&lt;li&gt;Enhanced the logic of the entire online shopping process&lt;/li&gt;
&lt;li&gt;Code refinement and bug fixed&lt;/li&gt;
&lt;li&gt;Added some tests (some tests are in local and weren’t committed as it requires some local envs)&lt;/li&gt;
&lt;/ul&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>Vert.x Microservice Blueprint | Basic Design</title>
    <link href="http://www.sczyh30.com/en/2016/08/01/vertx-blueprint-microservice-basic-design/"/>
    <id>http://www.sczyh30.com/en/2016/08/01/vertx-blueprint-microservice-basic-design/</id>
    <published>2016-07-31T16:00:00.000Z</published>
    <updated>2016-08-01T08:07:33.746Z</updated>
    
    <content type="html">&lt;p&gt;The blueprint is an online shopping microservice application. You can treat it as a very simple C2C market like eBay.&lt;/p&gt;
&lt;p&gt;Here is a diagram illustrating the microservice architecture:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://7xkkgd.com1.z0.glb.clouddn.com/vertx-msb-initial-structure.png&quot; alt=&quot;Basic Design&quot;&gt;&lt;/p&gt;
&lt;p&gt;Currently I designed these components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;account-microservice&lt;/code&gt;: Component for user account&lt;/li&gt;
&lt;li&gt;&lt;code&gt;product-microservice&lt;/code&gt;: Component for products we sell and buy&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store-microservice&lt;/code&gt;: Component for individual stores in the market&lt;/li&gt;
&lt;li&gt;&lt;code&gt;checkout-microservice&lt;/code&gt;: Compoment for order checkout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;payment-microservice&lt;/code&gt;: Compoment for payment transaction processing&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order-microservice&lt;/code&gt;: Compoment for order dispatching, processing, analyzing and storage&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: this component should be divided into several sub-components&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;recommendation-microservice&lt;/code&gt;: Compoment for simple recommendation for friends and favorite products with Neo4j&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cache-infrastructure&lt;/code&gt;: Cache component for services&lt;/li&gt;
&lt;li&gt;&lt;code&gt;api-gateway&lt;/code&gt;: API gateway (with load balance)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shopping-ui&lt;/code&gt;: A SPA front-end for the microservice&lt;/li&gt;
&lt;li&gt;&lt;code&gt;monitor-dashboard&lt;/code&gt;: Dashboard for performance monitoring and backend metrics data demonstration&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the user workflow: &lt;code&gt;User login and add products to chart -&amp;gt; Checkout -&amp;gt; Go to payment page and pay for the products -&amp;gt; Payment transaction success, order submitted -&amp;gt; (Wait for delivery...)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;All events are sent on the event bus.&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;The blueprint is an online shopping microservice application. You can treat it as a very simple C2C market like eBay.&lt;/p&gt;
&lt;p&gt;Here is a diagram illustrating the microservice architecture:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://7xkkgd.com1.z0.glb.clouddn.com/vertx-msb-initial-structure.png&quot; alt=&quot;Basic Design&quot;&gt;&lt;/p&gt;
&lt;p&gt;Currently I designed these components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;account-microservice&lt;/code&gt;: Component for user account&lt;/li&gt;
&lt;li&gt;&lt;code&gt;product-microservice&lt;/code&gt;: Component for products we sell and buy&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store-microservice&lt;/code&gt;: Component for individual stores in the market&lt;/li&gt;
&lt;li&gt;&lt;code&gt;checkout-microservice&lt;/code&gt;: Compoment for order checkout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;payment-microservice&lt;/code&gt;: Compoment for payment transaction processing&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order-microservice&lt;/code&gt;: Compoment for order dispatching, processing, analyzing and storage&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: this component should be divided into several sub-components&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;recommendation-microservice&lt;/code&gt;: Compoment for simple recommendation for friends and favorite products with Neo4j&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cache-infrastructure&lt;/code&gt;: Cache component for services&lt;/li&gt;
&lt;li&gt;&lt;code&gt;api-gateway&lt;/code&gt;: API gateway (with load balance)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shopping-ui&lt;/code&gt;: A SPA front-end for the microservice&lt;/li&gt;
&lt;li&gt;&lt;code&gt;monitor-dashboard&lt;/code&gt;: Dashboard for performance monitoring and backend metrics data demonstration&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the user workflow: &lt;code&gt;User login and add products to chart -&amp;gt; Checkout -&amp;gt; Go to payment page and pay for the products -&amp;gt; Payment transaction success, order submitted -&amp;gt; (Wait for delivery...)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;All events are sent on the event bus.&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
      <category term="Microservice" scheme="http://www.sczyh30.com/en/tags/Microservice/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 9 - Week 10</title>
    <link href="http://www.sczyh30.com/en/2016/08/01/gsoc-2016-work-period-week9-10/"/>
    <id>http://www.sczyh30.com/en/2016/08/01/gsoc-2016-work-period-week9-10/</id>
    <published>2016-07-31T16:00:00.000Z</published>
    <updated>2016-08-01T08:04:11.953Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Initial work for Online Shopping Microservice Blueprint&lt;/li&gt;
&lt;li&gt;Prepare for next blueprint application (high performance)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Good luck~ :-)&lt;/em&gt;&lt;/p&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;API-gateway&quot;&gt;&lt;a href=&quot;#API-gateway&quot; class=&quot;headerlink&quot; title=&quot;API gateway&quot;&gt;&lt;/a&gt;API gateway&lt;/h2&gt;&lt;p&gt;How to implement an API gateway with load balance.&lt;/p&gt;
&lt;h2 id=&quot;Checkout-model&quot;&gt;&lt;a href=&quot;#Checkout-model&quot; class=&quot;headerlink&quot; title=&quot;Checkout model&quot;&gt;&lt;/a&gt;Checkout model&lt;/h2&gt;&lt;p&gt;TODO: The checkout-payment-order model should be changed.&lt;/p&gt;
&lt;h2 id=&quot;Deployment&quot;&gt;&lt;a href=&quot;#Deployment&quot; class=&quot;headerlink&quot; title=&quot;Deployment&quot;&gt;&lt;/a&gt;Deployment&lt;/h2&gt;&lt;p&gt;In our design, the online shopping microservice blueprint contains many components, so we need to pay attention to how to deploy such a microservice application (e.g. use Docker Compose, Kubernetes; Deploy on Openshift)&lt;/p&gt;
&lt;h2 id=&quot;Order-dispatching-design&quot;&gt;&lt;a href=&quot;#Order-dispatching-design&quot; class=&quot;headerlink&quot; title=&quot;Order dispatching design&quot;&gt;&lt;/a&gt;Order dispatching design&lt;/h2&gt;&lt;p&gt;In our current design, orders are sent via clustered event bus. But a real production environment, orders are supposed to be dispatched to message queues with recovery and persistence ability(e.g. Kafka). And the order processing component and order persistence component should pull orders from the MQ.&lt;/p&gt;
&lt;h2 id=&quot;Integration-with-other-technologies&quot;&gt;&lt;a href=&quot;#Integration-with-other-technologies&quot; class=&quot;headerlink&quot; title=&quot;Integration with other technologies&quot;&gt;&lt;/a&gt;Integration with other technologies&lt;/h2&gt;&lt;p&gt;e.g. Kafka&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Initial work for Online Shopping Microservice Blueprint&lt;/li&gt;
&lt;/ul&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Initial work for Online Shopping Microservice Blueprint&lt;/li&gt;
&lt;li&gt;Prepare for next blueprint application (high performance)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Good luck~ :-)&lt;/em&gt;&lt;/p&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;API-gateway&quot;&gt;&lt;a href=&quot;#API-gateway&quot; class=&quot;headerlink&quot; title=&quot;API gateway&quot;&gt;&lt;/a&gt;API gateway&lt;/h2&gt;&lt;p&gt;How to implement an API gateway with load balance.&lt;/p&gt;
&lt;h2 id=&quot;Checkout-model&quot;&gt;&lt;a href=&quot;#Checkout-model&quot; class=&quot;headerlink&quot; title=&quot;Checkout model&quot;&gt;&lt;/a&gt;Checkout model&lt;/h2&gt;&lt;p&gt;TODO: The checkout-payment-order model should be changed.&lt;/p&gt;
&lt;h2 id=&quot;Deployment&quot;&gt;&lt;a href=&quot;#Deployment&quot; class=&quot;headerlink&quot; title=&quot;Deployment&quot;&gt;&lt;/a&gt;Deployment&lt;/h2&gt;&lt;p&gt;In our design, the online shopping microservice blueprint contains many components, so we need to pay attention to how to deploy such a microservice application (e.g. use Docker Compose, Kubernetes; Deploy on Openshift)&lt;/p&gt;
&lt;h2 id=&quot;Order-dispatching-design&quot;&gt;&lt;a href=&quot;#Order-dispatching-design&quot; class=&quot;headerlink&quot; title=&quot;Order dispatching design&quot;&gt;&lt;/a&gt;Order dispatching design&lt;/h2&gt;&lt;p&gt;In our current design, orders are sent via clustered event bus. But a real production environment, orders are supposed to be dispatched to message queues with recovery and persistence ability(e.g. Kafka). And the order processing component and order persistence component should pull orders from the MQ.&lt;/p&gt;
&lt;h2 id=&quot;Integration-with-other-technologies&quot;&gt;&lt;a href=&quot;#Integration-with-other-technologies&quot; class=&quot;headerlink&quot; title=&quot;Integration with other technologies&quot;&gt;&lt;/a&gt;Integration with other technologies&lt;/h2&gt;&lt;p&gt;e.g. Kafka&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Initial work for Online Shopping Microservice Blueprint&lt;/li&gt;
&lt;/ul&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 7 - Week 8</title>
    <link href="http://www.sczyh30.com/en/2016/07/16/gsoc-2016-work-period-week-7/"/>
    <id>http://www.sczyh30.com/en/2016/07/16/gsoc-2016-work-period-week-7/</id>
    <published>2016-07-15T16:00:00.000Z</published>
    <updated>2016-08-01T05:25:49.505Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finish Chinese documentation of Vert.x Kue&lt;/li&gt;
&lt;li&gt;Work on microservice blueprint&lt;/li&gt;
&lt;li&gt;Learn more about &lt;strong&gt;Vert.x Microservice&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notice:&lt;/strong&gt; Because my semester final exams is pending this week and next week, I’ll have to be busy with them. So I might spend less time on it (have time in the evening). After the final exams I’ll speed up and make a wonderful blueprint!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Good luck~ :-)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The final exams finally finished!!!&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finish Chinese documentation of Vert.x Kue&lt;/li&gt;
&lt;li&gt;Work on microservice blueprint&lt;/li&gt;
&lt;li&gt;Learn more about &lt;strong&gt;Vert.x Microservice&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notice:&lt;/strong&gt; Because my semester final exams is pending this week and next week, I’ll have to be busy with them. So I might spend less time on it (have time in the evening). After the final exams I’ll speed up and make a wonderful blueprint!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Good luck~ :-)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The final exams finally finished!!!&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 5 - Week 6</title>
    <link href="http://www.sczyh30.com/en/2016/07/03/gsoc-2016-work-period-week5-6/"/>
    <id>http://www.sczyh30.com/en/2016/07/03/gsoc-2016-work-period-week5-6/</id>
    <published>2016-07-02T16:00:00.000Z</published>
    <updated>2016-07-03T17:42:11.782Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some extra things to implement or fix:&lt;ul&gt;
&lt;li&gt;Job active TTL check&lt;/li&gt;
&lt;li&gt;Job search functionality&lt;/li&gt;
&lt;li&gt;Render issue with &lt;code&gt;_filter.jade&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Finish documents and tutorials of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Finish tests&lt;/li&gt;
&lt;li&gt;Add Docker Compose file&lt;/li&gt;
&lt;li&gt;Prepare for the microservice blueprint&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Good luck~ :-)&lt;/em&gt;&lt;/p&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;TODO-Job-search-functionality&quot;&gt;&lt;a href=&quot;#TODO-Job-search-functionality&quot; class=&quot;headerlink&quot; title=&quot;TODO: Job search functionality&quot;&gt;&lt;/a&gt;TODO: Job search functionality&lt;/h2&gt;&lt;p&gt;This need a full-index engine.&lt;/p&gt;
&lt;h2 id=&quot;TODO-Run-Vert-x-Kue-in-Docker-Cluster&quot;&gt;&lt;a href=&quot;#TODO-Run-Vert-x-Kue-in-Docker-Cluster&quot; class=&quot;headerlink&quot; title=&quot;TODO: Run Vert.x Kue in Docker Cluster&quot;&gt;&lt;/a&gt;TODO: Run Vert.x Kue in Docker Cluster&lt;/h2&gt;&lt;p&gt;Maybe we need some configurations for Hazelcast to support it on Docker.&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Finish English documents and tutorials of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Finish part of Chinese documents and tutorials of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Initial design for bluepint microservice&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These days my progress is slow…Because I have to prepare for the final exam(7.1 - 7.15) these days…&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some extra things to implement or fix:&lt;ul&gt;
&lt;li&gt;Job active TTL check&lt;/li&gt;
&lt;li&gt;Job search functionality&lt;/li&gt;
&lt;li&gt;Render issue with &lt;code&gt;_filter.jade&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Finish documents and tutorials of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Finish tests&lt;/li&gt;
&lt;li&gt;Add Docker Compose file&lt;/li&gt;
&lt;li&gt;Prepare for the microservice blueprint&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Good luck~ :-)&lt;/em&gt;&lt;/p&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;TODO-Job-search-functionality&quot;&gt;&lt;a href=&quot;#TODO-Job-search-functionality&quot; class=&quot;headerlink&quot; title=&quot;TODO: Job search functionality&quot;&gt;&lt;/a&gt;TODO: Job search functionality&lt;/h2&gt;&lt;p&gt;This need a full-index engine.&lt;/p&gt;
&lt;h2 id=&quot;TODO-Run-Vert-x-Kue-in-Docker-Cluster&quot;&gt;&lt;a href=&quot;#TODO-Run-Vert-x-Kue-in-Docker-Cluster&quot; class=&quot;headerlink&quot; title=&quot;TODO: Run Vert.x Kue in Docker Cluster&quot;&gt;&lt;/a&gt;TODO: Run Vert.x Kue in Docker Cluster&lt;/h2&gt;&lt;p&gt;Maybe we need some configurations for Hazelcast to support it on Docker.&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Finish English documents and tutorials of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Finish part of Chinese documents and tutorials of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Initial design for bluepint microservice&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These days my progress is slow…Because I have to prepare for the final exam(7.1 - 7.15) these days…&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>Vert.x Kue | A brief introduction to how it works</title>
    <link href="http://www.sczyh30.com/en/2016/06/20/vertx-kue-brief-introduction-how-it-works/"/>
    <id>http://www.sczyh30.com/en/2016/06/20/vertx-kue-brief-introduction-how-it-works/</id>
    <published>2016-06-20T02:00:00.000Z</published>
    <updated>2016-07-03T17:31:21.070Z</updated>
    
    <content type="html">&lt;p&gt;In this blog post, I’ll give a brief introduction to illustrate how Vert.x Kue works.&lt;/p&gt;
&lt;p&gt;In the workflow, first we deploy the &lt;code&gt;KueVerticle&lt;/code&gt; in clustered mode and register the &lt;code&gt;JobService&lt;/code&gt; on the event bus. The &lt;code&gt;JobService&lt;/code&gt; consists of various logic of &lt;code&gt;Job&lt;/code&gt;. After that, we could then deploy &lt;code&gt;KueHttpVerticle&lt;/code&gt; to provide REST API. Most of the apis calls &lt;code&gt;Future&lt;/code&gt;-based methods in &lt;code&gt;Kue&lt;/code&gt;. Finally we could deploy our job processing verticle. The verticle usually consists of three parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create &lt;code&gt;Kue&lt;/code&gt; instance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we create &lt;code&gt;Kue&lt;/code&gt; instance, the inner &lt;code&gt;JobService&lt;/code&gt; proxy and redis client will be created. Also, the static &lt;code&gt;Vertx&lt;/code&gt; field in &lt;code&gt;Job&lt;/code&gt; class will also be initilized.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create and save &lt;code&gt;Job&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here we could set job properties and subscribe events from the job address(via event bus).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;process the &lt;code&gt;Job&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we call the &lt;code&gt;process&lt;/code&gt; or &lt;code&gt;processBlocking&lt;/code&gt; method, Vert.x Kue will create and then deploy some &lt;strong&gt;KueWorkers&lt;/strong&gt;, which is a kind of verticle(or worker verticle, if calling &lt;code&gt;processBlocking&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;KueWorker&lt;/code&gt;, we first get &lt;code&gt;Job&lt;/code&gt; from Redis backend (&lt;code&gt;zpop&lt;/code&gt; operation):&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;prepareAndStart&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.getJobFromBackend().setHandler(jr -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; (jr.succeeded()) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; (jr.result().isPresent()) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.job = jr.result().get();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        process();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125; &lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; IllegalStateException(&lt;span class=&quot;string&quot;&gt;&quot;job not exist&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125; &lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      jr.cause().printStackTrace();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;If the &lt;code&gt;KueWorker&lt;/code&gt; successfully gets the job, it will do process procedure. First we set &lt;code&gt;started_at&lt;/code&gt; flag on the job and then save it to the backend. Then we emit the job &lt;strong&gt;start&lt;/strong&gt; event on the event bus(both job address and worker address). Next, we will process the job using the given handler. Simultaneously, we consume &lt;code&gt;done&lt;/code&gt; and &lt;code&gt;done_fail&lt;/code&gt; events on the job-specific address. If &lt;code&gt;done&lt;/code&gt; event received, the job should be completed and we emit &lt;code&gt;complete&lt;/code&gt; event. If &lt;code&gt;done_fail&lt;/code&gt; event received, the job should be failed so we first do a failed attempt. If attempt failed, then send &lt;code&gt;error&lt;/code&gt; event on worker address. Else send &lt;code&gt;failed&lt;/code&gt; or &lt;code&gt;failed_attempt&lt;/code&gt; event depending on the attempt status.&lt;/p&gt;
&lt;p&gt;There are three kinds of address:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;18&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;19&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;20&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;21&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;22&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;23&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;24&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;25&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;26&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Handler address with certain job on event bus&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Format: vertx.kue.handler.job.&amp;#123;handlerType&amp;#125;.&amp;#123;addressId&amp;#125;.&amp;#123;jobType&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   *&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * &lt;span class=&quot;doctag&quot;&gt;@return&lt;/span&gt; corresponding address&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; String &lt;span class=&quot;title&quot;&gt;getCertainJobAddress&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(String handlerType, Job job)&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;string&quot;&gt;&quot;vertx.kue.handler.job.&quot;&lt;/span&gt; + handlerType + &lt;span class=&quot;string&quot;&gt;&quot;.&quot;&lt;/span&gt; + job.getAddress_id() + &lt;span class=&quot;string&quot;&gt;&quot;.&quot;&lt;/span&gt; + job.getType();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; * Global worker address with specific event type&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; String &lt;span class=&quot;title&quot;&gt;workerAddress&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(String eventType)&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;string&quot;&gt;&quot;vertx.kue.handler.workers.&quot;&lt;/span&gt; + eventType;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Worker address with specific event type and job-uuid on event bus&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Format: vertx.kue.handler.workers.&amp;#123;eventType&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   *&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * &lt;span class=&quot;doctag&quot;&gt;@return&lt;/span&gt; corresponding address&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; String &lt;span class=&quot;title&quot;&gt;workerAddress&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(String eventType, Job job)&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;string&quot;&gt;&quot;vertx.kue.handler.workers.&quot;&lt;/span&gt; + eventType + &lt;span class=&quot;string&quot;&gt;&quot;.&quot;&lt;/span&gt; + job.getAddress_id();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;h2 id=&quot;Diagram&quot;&gt;&lt;a href=&quot;#Diagram&quot; class=&quot;headerlink&quot; title=&quot;Diagram&quot;&gt;&lt;/a&gt;Diagram&lt;/h2&gt;&lt;p&gt;&lt;img src=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/raw/initial-work/docs/images/kue_diagram.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;In this blog post, I’ll give a brief introduction to illustrate how Vert.x Kue works.&lt;/p&gt;
&lt;p&gt;In the workflow, first we deploy the &lt;code&gt;KueVerticle&lt;/code&gt; in clustered mode and register the &lt;code&gt;JobService&lt;/code&gt; on the event bus. The &lt;code&gt;JobService&lt;/code&gt; consists of various logic of &lt;code&gt;Job&lt;/code&gt;. After that, we could then deploy &lt;code&gt;KueHttpVerticle&lt;/code&gt; to provide REST API. Most of the apis calls &lt;code&gt;Future&lt;/code&gt;-based methods in &lt;code&gt;Kue&lt;/code&gt;. Finally we could deploy our job processing verticle. The verticle usually consists of three parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create &lt;code&gt;Kue&lt;/code&gt; instance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we create &lt;code&gt;Kue&lt;/code&gt; instance, the inner &lt;code&gt;JobService&lt;/code&gt; proxy and redis client will be created. Also, the static &lt;code&gt;Vertx&lt;/code&gt; field in &lt;code&gt;Job&lt;/code&gt; class will also be initilized.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create and save &lt;code&gt;Job&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here we could set job properties and subscribe events from the job address(via event bus).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;process the &lt;code&gt;Job&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we call the &lt;code&gt;process&lt;/code&gt; or &lt;code&gt;processBlocking&lt;/code&gt; method, Vert.x Kue will create and then deploy some &lt;strong&gt;KueWorkers&lt;/strong&gt;, which is a kind of verticle(or worker verticle, if calling &lt;code&gt;processBlocking&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;KueWorker&lt;/code&gt;, we first get &lt;code&gt;Job&lt;/code&gt; from Redis backend (&lt;code&gt;zpop&lt;/code&gt; operation):&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;prepareAndStart&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.getJobFromBackend().setHandler(jr -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; (jr.succeeded()) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; (jr.result().isPresent()) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.job = jr.result().get();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        process();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125; &lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; IllegalStateException(&lt;span class=&quot;string&quot;&gt;&quot;job not exist&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125; &lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      jr.cause().printStackTrace();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;If the &lt;code&gt;KueWorker&lt;/code&gt; successfully gets the job, it will do process procedure. First we set &lt;code&gt;started_at&lt;/code&gt; flag on the job and then save it to the backend. Then we emit the job &lt;strong&gt;start&lt;/strong&gt; event on the event bus(both job address and worker address). Next, we will process the job using the given handler. Simultaneously, we consume &lt;code&gt;done&lt;/code&gt; and &lt;code&gt;done_fail&lt;/code&gt; events on the job-specific address. If &lt;code&gt;done&lt;/code&gt; event received, the job should be completed and we emit &lt;code&gt;complete&lt;/code&gt; event. If &lt;code&gt;done_fail&lt;/code&gt; event received, the job should be failed so we first do a failed attempt. If attempt failed, then send &lt;code&gt;error&lt;/code&gt; event on worker address. Else send &lt;code&gt;failed&lt;/code&gt; or &lt;code&gt;failed_attempt&lt;/code&gt; event depending on the attempt status.&lt;/p&gt;
&lt;p&gt;There are three kinds of address:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;18&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;19&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;20&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;21&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;22&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;23&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;24&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;25&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;26&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Handler address with certain job on event bus&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Format: vertx.kue.handler.job.&amp;#123;handlerType&amp;#125;.&amp;#123;addressId&amp;#125;.&amp;#123;jobType&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   *&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * &lt;span class=&quot;doctag&quot;&gt;@return&lt;/span&gt; corresponding address&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; String &lt;span class=&quot;title&quot;&gt;getCertainJobAddress&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(String handlerType, Job job)&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;string&quot;&gt;&quot;vertx.kue.handler.job.&quot;&lt;/span&gt; + handlerType + &lt;span class=&quot;string&quot;&gt;&quot;.&quot;&lt;/span&gt; + job.getAddress_id() + &lt;span class=&quot;string&quot;&gt;&quot;.&quot;&lt;/span&gt; + job.getType();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; * Global worker address with specific event type&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; String &lt;span class=&quot;title&quot;&gt;workerAddress&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(String eventType)&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;string&quot;&gt;&quot;vertx.kue.handler.workers.&quot;&lt;/span&gt; + eventType;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Worker address with specific event type and job-uuid on event bus&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * Format: vertx.kue.handler.workers.&amp;#123;eventType&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   *&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   * &lt;span class=&quot;doctag&quot;&gt;@return&lt;/span&gt; corresponding address&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;   */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; String &lt;span class=&quot;title&quot;&gt;workerAddress&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(String eventType, Job job)&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;string&quot;&gt;&quot;vertx.kue.handler.workers.&quot;&lt;/span&gt; + eventType + &lt;span class=&quot;string&quot;&gt;&quot;.&quot;&lt;/span&gt; + job.getAddress_id();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;h2 id=&quot;Diagram&quot;&gt;&lt;a href=&quot;#Diagram&quot; class=&quot;headerlink&quot; title=&quot;Diagram&quot;&gt;&lt;/a&gt;Diagram&lt;/h2&gt;&lt;p&gt;&lt;img src=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/raw/initial-work/docs/images/kue_diagram.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
      <category term="Kue" scheme="http://www.sczyh30.com/en/tags/Kue/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 4</title>
    <link href="http://www.sczyh30.com/en/2016/06/20/gsoc-2016-work-period-week4/"/>
    <id>http://www.sczyh30.com/en/2016/06/20/gsoc-2016-work-period-week4/</id>
    <published>2016-06-19T16:00:00.000Z</published>
    <updated>2016-06-20T12:47:18.548Z</updated>
    
    <content type="html">&lt;p&gt;The GSoC Midterm Evaluation is coming~ Boost~O(∩_∩)O&lt;/p&gt;
&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enhance &lt;strong&gt;Event system&lt;/strong&gt; and &lt;code&gt;KueWorker&lt;/code&gt; in Kue&lt;ul&gt;
&lt;li&gt;Implement all basic events in original Kue&lt;/li&gt;
&lt;li&gt;If possible, do some performance optimization&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add test cases and fix bugs&lt;/li&gt;
&lt;li&gt;Add more examples&lt;/li&gt;
&lt;li&gt;Finish all Vert.x Kue REST apis&lt;/li&gt;
&lt;li&gt;Adapt Vert.x Kue REST API with original Kue’s UI&lt;/li&gt;
&lt;li&gt;Code refinement&lt;/li&gt;
&lt;li&gt;Initial document and design diagram update&lt;/li&gt;
&lt;li&gt;Learn more about new features in Vert.x 3.3.0&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;initial-work&lt;/code&gt; implementation of &lt;strong&gt;Vert.x Kue&lt;/strong&gt; (including Vert.x Kue REST API and UI)&lt;ul&gt;
&lt;li&gt;See: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/tree/initial-work&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bugs fixed&lt;/li&gt;
&lt;li&gt;Add more examples&lt;/li&gt;
&lt;li&gt;Some refactor and code refinement&lt;/li&gt;
&lt;li&gt;Feature document draft&lt;/li&gt;
&lt;/ul&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;The GSoC Midterm Evaluation is coming~ Boost~O(∩_∩)O&lt;/p&gt;
&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enhance &lt;strong&gt;Event system&lt;/strong&gt; and &lt;code&gt;KueWorker&lt;/code&gt; in Kue&lt;ul&gt;
&lt;li&gt;Implement all basic events in original Kue&lt;/li&gt;
&lt;li&gt;If possible, do some performance optimization&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add test cases and fix bugs&lt;/li&gt;
&lt;li&gt;Add more examples&lt;/li&gt;
&lt;li&gt;Finish all Vert.x Kue REST apis&lt;/li&gt;
&lt;li&gt;Adapt Vert.x Kue REST API with original Kue’s UI&lt;/li&gt;
&lt;li&gt;Code refinement&lt;/li&gt;
&lt;li&gt;Initial document and design diagram update&lt;/li&gt;
&lt;li&gt;Learn more about new features in Vert.x 3.3.0&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;initial-work&lt;/code&gt; implementation of &lt;strong&gt;Vert.x Kue&lt;/strong&gt; (including Vert.x Kue REST API and UI)&lt;ul&gt;
&lt;li&gt;See: &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/tree/initial-work&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bugs fixed&lt;/li&gt;
&lt;li&gt;Add more examples&lt;/li&gt;
&lt;li&gt;Some refactor and code refinement&lt;/li&gt;
&lt;li&gt;Feature document draft&lt;/li&gt;
&lt;/ul&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 3</title>
    <link href="http://www.sczyh30.com/en/2016/06/12/gsoc-2016-work-period-week3/"/>
    <id>http://www.sczyh30.com/en/2016/06/12/gsoc-2016-work-period-week3/</id>
    <published>2016-06-12T15:00:00.000Z</published>
    <updated>2016-08-01T08:03:58.591Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Core component of Vert.x Kue implementation complete&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Event system&lt;/strong&gt; in Kue&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueWorker&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Job&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Basic implementation of Vert.x Kue HTTP component&lt;ul&gt;
&lt;li&gt;REST API implementation&lt;/li&gt;
&lt;li&gt;A simple UI (Vert.x Kue UI)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Refine the code of Vert.x Kue&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;Job&lt;/code&gt; class is messy and need refinement&lt;/li&gt;
&lt;li&gt;More concise&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Learn more about microservice (as well as Vert.x Microservice Toolbox)&lt;/li&gt;
&lt;li&gt;Write a brief introduction to new features of Vert.x 3.3.0 (in Chinese, will publish in &lt;em&gt;Vert.x China Group&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;PS: &lt;strong&gt;The Dragon Boat Festival&lt;/strong&gt; holiday will be coming from Thursday to Saturday this week so I may not spend very much time on work during the holiday~ &lt;em&gt;Have a great week :-)&lt;/em&gt;&lt;/p&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;Solved-Regex-match-in-route-path&quot;&gt;&lt;a href=&quot;#Solved-Regex-match-in-route-path&quot; class=&quot;headerlink&quot; title=&quot;Solved: Regex match in route path&quot;&gt;&lt;/a&gt;Solved: Regex match in route path&lt;/h2&gt;&lt;p&gt;In original Kue’s API, there is a route with path &lt;code&gt;/jobs/:from..:to/:order?&lt;/code&gt;. I tried this in Vert.x Web(&lt;code&gt;/jobs/:from..:to&lt;/code&gt;) but Vert.x Web cannot match it. So I used regex match &lt;code&gt;\/jobs\/([0-9]*)\.\.([0-9]*)(\/[^\/]+)?&lt;/code&gt;:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;final&lt;/span&gt; String KUE_API_JOB_RANGE = &lt;span class=&quot;string&quot;&gt;&quot;\\/jobs\\/([0-9]*)\\.\\.([0-9]*)(\\/[^\\/]+)?&quot;&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// ...&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;router.getWithRegex(KUE_API_JOB_RANGE).handler(&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;::apiJobRange);&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;But nothing matched, which made me confused. And path like &lt;code&gt;/jobs/:from/to/:to&lt;/code&gt; can be matched.&lt;/p&gt;
&lt;p&gt;Solution: First use a supported pattern to catch string like &lt;code&gt;1..10&lt;/code&gt; then use regex parse.&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;h2 id=&quot;Implementation-of-Vert-x-Kue-core&quot;&gt;&lt;a href=&quot;#Implementation-of-Vert-x-Kue-core&quot; class=&quot;headerlink&quot; title=&quot;Implementation of Vert.x Kue core&quot;&gt;&lt;/a&gt;Implementation of Vert.x Kue core&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Job processing interface &lt;code&gt;KueService&lt;/code&gt; now provides two methods: &lt;code&gt;process&lt;/code&gt; method do asynchronous procedure(use common verticles), while &lt;code&gt;processBlocking&lt;/code&gt; method could do blocking procedure(use worker verticles)&lt;/li&gt;
&lt;li&gt;Add attempt support (could attempt when fails)&lt;ul&gt;
&lt;li&gt;&lt;em&gt;TODO: need enhancement and test&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add worker and job cardinality metrics support&lt;/li&gt;
&lt;li&gt;Add support for getting jobs with range(rank)&lt;/li&gt;
&lt;li&gt;Basic refinement of &lt;code&gt;Job&lt;/code&gt; class&lt;/li&gt;
&lt;li&gt;Refactored most of async methods to &lt;code&gt;Future&lt;/code&gt; based style (in order to support monadic transform and say goodbye to callback hell)&lt;/li&gt;
&lt;li&gt;Fix issue: Sometimes throw &lt;code&gt;java.lang.ClassCastException&lt;/code&gt; caused by wrong time flow when processing a job&lt;/li&gt;
&lt;li&gt;Fix issue: Generated json converter &lt;em&gt;sometimes&lt;/em&gt; could not distinguish some properties(e.g. &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;jobMetrics&lt;/code&gt;) correctly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See here:  &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/tree/initial-work&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;Basic-implementation-of-Vert-x-Kue-HTTP-component&quot;&gt;&lt;a href=&quot;#Basic-implementation-of-Vert-x-Kue-HTTP-component&quot; class=&quot;headerlink&quot; title=&quot;Basic implementation of Vert.x Kue HTTP component&quot;&gt;&lt;/a&gt;Basic implementation of Vert.x Kue HTTP component&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Basic implementation of Vert.x Kue REST API(get job, create job, delete job, get job by range(or state), etc)&lt;/li&gt;
&lt;li&gt;Basic adaption between Vert.x Web and original Kue UI (rendered with &lt;code&gt;vertx-web-templ-jade&lt;/code&gt;; still have some problems to solve)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Wrote-a-brief-introduction-to-new-features-of-Vert-x-3-3-0-in-Chinese&quot;&gt;&lt;a href=&quot;#Wrote-a-brief-introduction-to-new-features-of-Vert-x-3-3-0-in-Chinese&quot; class=&quot;headerlink&quot; title=&quot;Wrote a brief introduction to new features of Vert.x 3.3.0 in Chinese&quot;&gt;&lt;/a&gt;Wrote a brief introduction to new features of Vert.x 3.3.0 in Chinese&lt;/h2&gt;&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Core component of Vert.x Kue implementation complete&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Event system&lt;/strong&gt; in Kue&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueWorker&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Job&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Basic implementation of Vert.x Kue HTTP component&lt;ul&gt;
&lt;li&gt;REST API implementation&lt;/li&gt;
&lt;li&gt;A simple UI (Vert.x Kue UI)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Refine the code of Vert.x Kue&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;Job&lt;/code&gt; class is messy and need refinement&lt;/li&gt;
&lt;li&gt;More concise&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Learn more about microservice (as well as Vert.x Microservice Toolbox)&lt;/li&gt;
&lt;li&gt;Write a brief introduction to new features of Vert.x 3.3.0 (in Chinese, will publish in &lt;em&gt;Vert.x China Group&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;PS: &lt;strong&gt;The Dragon Boat Festival&lt;/strong&gt; holiday will be coming from Thursday to Saturday this week so I may not spend very much time on work during the holiday~ &lt;em&gt;Have a great week :-)&lt;/em&gt;&lt;/p&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;Solved-Regex-match-in-route-path&quot;&gt;&lt;a href=&quot;#Solved-Regex-match-in-route-path&quot; class=&quot;headerlink&quot; title=&quot;Solved: Regex match in route path&quot;&gt;&lt;/a&gt;Solved: Regex match in route path&lt;/h2&gt;&lt;p&gt;In original Kue’s API, there is a route with path &lt;code&gt;/jobs/:from..:to/:order?&lt;/code&gt;. I tried this in Vert.x Web(&lt;code&gt;/jobs/:from..:to&lt;/code&gt;) but Vert.x Web cannot match it. So I used regex match &lt;code&gt;\/jobs\/([0-9]*)\.\.([0-9]*)(\/[^\/]+)?&lt;/code&gt;:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;final&lt;/span&gt; String KUE_API_JOB_RANGE = &lt;span class=&quot;string&quot;&gt;&quot;\\/jobs\\/([0-9]*)\\.\\.([0-9]*)(\\/[^\\/]+)?&quot;&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// ...&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;router.getWithRegex(KUE_API_JOB_RANGE).handler(&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;::apiJobRange);&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;But nothing matched, which made me confused. And path like &lt;code&gt;/jobs/:from/to/:to&lt;/code&gt; can be matched.&lt;/p&gt;
&lt;p&gt;Solution: First use a supported pattern to catch string like &lt;code&gt;1..10&lt;/code&gt; then use regex parse.&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;h2 id=&quot;Implementation-of-Vert-x-Kue-core&quot;&gt;&lt;a href=&quot;#Implementation-of-Vert-x-Kue-core&quot; class=&quot;headerlink&quot; title=&quot;Implementation of Vert.x Kue core&quot;&gt;&lt;/a&gt;Implementation of Vert.x Kue core&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Job processing interface &lt;code&gt;KueService&lt;/code&gt; now provides two methods: &lt;code&gt;process&lt;/code&gt; method do asynchronous procedure(use common verticles), while &lt;code&gt;processBlocking&lt;/code&gt; method could do blocking procedure(use worker verticles)&lt;/li&gt;
&lt;li&gt;Add attempt support (could attempt when fails)&lt;ul&gt;
&lt;li&gt;&lt;em&gt;TODO: need enhancement and test&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add worker and job cardinality metrics support&lt;/li&gt;
&lt;li&gt;Add support for getting jobs with range(rank)&lt;/li&gt;
&lt;li&gt;Basic refinement of &lt;code&gt;Job&lt;/code&gt; class&lt;/li&gt;
&lt;li&gt;Refactored most of async methods to &lt;code&gt;Future&lt;/code&gt; based style (in order to support monadic transform and say goodbye to callback hell)&lt;/li&gt;
&lt;li&gt;Fix issue: Sometimes throw &lt;code&gt;java.lang.ClassCastException&lt;/code&gt; caused by wrong time flow when processing a job&lt;/li&gt;
&lt;li&gt;Fix issue: Generated json converter &lt;em&gt;sometimes&lt;/em&gt; could not distinguish some properties(e.g. &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;jobMetrics&lt;/code&gt;) correctly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See here:  &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/tree/initial-work&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;Basic-implementation-of-Vert-x-Kue-HTTP-component&quot;&gt;&lt;a href=&quot;#Basic-implementation-of-Vert-x-Kue-HTTP-component&quot; class=&quot;headerlink&quot; title=&quot;Basic implementation of Vert.x Kue HTTP component&quot;&gt;&lt;/a&gt;Basic implementation of Vert.x Kue HTTP component&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Basic implementation of Vert.x Kue REST API(get job, create job, delete job, get job by range(or state), etc)&lt;/li&gt;
&lt;li&gt;Basic adaption between Vert.x Web and original Kue UI (rendered with &lt;code&gt;vertx-web-templ-jade&lt;/code&gt;; still have some problems to solve)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Wrote-a-brief-introduction-to-new-features-of-Vert-x-3-3-0-in-Chinese&quot;&gt;&lt;a href=&quot;#Wrote-a-brief-introduction-to-new-features-of-Vert-x-3-3-0-in-Chinese&quot; class=&quot;headerlink&quot; title=&quot;Wrote a brief introduction to new features of Vert.x 3.3.0 in Chinese&quot;&gt;&lt;/a&gt;Wrote a brief introduction to new features of Vert.x 3.3.0 in Chinese&lt;/h2&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 2</title>
    <link href="http://www.sczyh30.com/en/2016/06/06/gsoc-2016-work-period-week2/"/>
    <id>http://www.sczyh30.com/en/2016/06/06/gsoc-2016-work-period-week2/</id>
    <published>2016-06-05T16:00:00.000Z</published>
    <updated>2016-06-06T11:22:12.561Z</updated>
    
    <content type="html">&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Work on the &lt;strong&gt;Vert.x Blueprint - Kue&lt;/strong&gt; (Initial implementation)&lt;/li&gt;
&lt;li&gt;Learn more about event-driven and message system&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Knowledge-got&quot;&gt;&lt;a href=&quot;#Knowledge-got&quot; class=&quot;headerlink&quot; title=&quot;Knowledge got&quot;&gt;&lt;/a&gt;Knowledge got&lt;/h1&gt;&lt;p&gt;This week I’ve learned a lot!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Clustered Verticles and how to interact with each other&lt;/li&gt;
&lt;li&gt;Vert.x Event Bus (&lt;em&gt;send/recv&lt;/em&gt; and &lt;em&gt;pub/sub&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Vert.x Service Proxy&lt;/li&gt;
&lt;li&gt;More understanding about Redis(sorted set, list, pub/sub, transaction, etc)&lt;/li&gt;
&lt;li&gt;More understanding about asynchronous and reactive pattern(&lt;code&gt;Handler&lt;/code&gt; / &lt;code&gt;Future&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;How-to-implement-priority&quot;&gt;&lt;a href=&quot;#How-to-implement-priority&quot; class=&quot;headerlink&quot; title=&quot;How to implement priority?&quot;&gt;&lt;/a&gt;How to implement priority?&lt;/h2&gt;&lt;p&gt;I imitate Kue in Node.js: use &lt;strong&gt;sorted sets&lt;/strong&gt; in Redis and mark the priority as the score(weight). Use &lt;code&gt;zadd&lt;/code&gt; to add a certain id of job and when necessary, use &lt;code&gt;zpop&lt;/code&gt;(implemented with transaction) to get a job with higher priority.&lt;/p&gt;
&lt;h2 id=&quot;How-to-emit-and-receive-events&quot;&gt;&lt;a href=&quot;#How-to-emit-and-receive-events&quot; class=&quot;headerlink&quot; title=&quot;How to emit and receive events?&quot;&gt;&lt;/a&gt;How to emit and receive events?&lt;/h2&gt;&lt;p&gt;In Node.js, we could use &lt;code&gt;EventEmitter&lt;/code&gt; to emit and listen to events. And in Vert.x, we could make full use of &lt;code&gt;EventBus&lt;/code&gt;, which supports three kinds of pattern. For example, in Node.js we may write this:&lt;/p&gt;
&lt;figure class=&quot;highlight js&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;self.on(&lt;span class=&quot;string&quot;&gt;&#39;complete&#39;&lt;/span&gt;, fn);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// ......&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;self.emit(&lt;span class=&quot;string&quot;&gt;&#39;complete&#39;&lt;/span&gt;, res);&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;And in Vert.x we could write:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// listen to an address&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;eventBus.consumer(Kue.getHandlerAddress(&lt;span class=&quot;string&quot;&gt;&quot;complete&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.type), message -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      completeHandler.handle(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; Job((JsonObject) message.body()));&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// send message to an address&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;eventBus.send(Kue.getHandlerAddress(&lt;span class=&quot;string&quot;&gt;&quot;complete&quot;&lt;/span&gt;, type), job.toJson());&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;h2 id=&quot;Refined-the-design-of-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Refined-the-design-of-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Refined the design of Vert.x Kue&quot;&gt;&lt;/a&gt;Refined the design of Vert.x Kue&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Kue&lt;/code&gt;: like the &lt;code&gt;Queue&lt;/code&gt; in Kue. We could &lt;code&gt;createJob&lt;/code&gt; and &lt;code&gt;process&lt;/code&gt; the job&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueVerticle&lt;/code&gt;: a verticle where the &lt;code&gt;KueService&lt;/code&gt; is registered&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueWorker&lt;/code&gt;: a worker verticle that processes the job&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueService&lt;/code&gt;: create &lt;code&gt;KueWorker&lt;/code&gt; and deploy it&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Job&lt;/code&gt;: the job entity, contains numerous logic about job&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The backend of Vert.x Kue is &lt;strong&gt;Redis&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Basic usage (design) of Vert.x Kue:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;18&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;19&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;20&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;21&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;22&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;23&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;24&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;25&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;26&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;27&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;28&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;29&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;30&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;31&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// write this and then run with Vert.x Launcher in clustered mode&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;ExampleProcessVerticle&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;AbstractVerticle&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;meta&quot;&gt;@Override&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;throws&lt;/span&gt; Exception &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;comment&quot;&gt;// must first create kue&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    Kue kue = Kue.createQueue(vertx, config());&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    Job job0 = kue.createJob(&lt;span class=&quot;string&quot;&gt;&quot;video&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; JsonObject().put(&lt;span class=&quot;string&quot;&gt;&quot;id&quot;&lt;/span&gt;, &lt;span class=&quot;number&quot;&gt;3001&lt;/span&gt;))&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      .priority(Priority.HIGH)&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      .onComplete(e -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        System.out.println(&lt;span class=&quot;string&quot;&gt;&quot;Video result: &quot;&lt;/span&gt; + e.getResult());&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        System.out.println(&lt;span class=&quot;string&quot;&gt;&quot;Haha&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    job0.save();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    kue.process(&lt;span class=&quot;string&quot;&gt;&quot;video&quot;&lt;/span&gt;, &lt;span class=&quot;number&quot;&gt;1&lt;/span&gt;, r -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; (r.succeeded()) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        Job job = r.result();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;comment&quot;&gt;// consume 2 seconds&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        vertx.setTimer(&lt;span class=&quot;number&quot;&gt;2000&lt;/span&gt;, l -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;          job.progress(&lt;span class=&quot;number&quot;&gt;100&lt;/span&gt;, &lt;span class=&quot;number&quot;&gt;100&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;          System.out.println(&lt;span class=&quot;string&quot;&gt;&quot;Video id: &quot;&lt;/span&gt; + job.getId());&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125; &lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        r.cause().printStackTrace();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;h2 id=&quot;Initial-concept-implementation-of-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Initial-concept-implementation-of-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Initial concept implementation of Vert.x Kue&quot;&gt;&lt;/a&gt;Initial concept implementation of Vert.x Kue&lt;/h2&gt;&lt;p&gt;See here:  &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/tree/initial-work&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Work on the &lt;strong&gt;Vert.x Blueprint - Kue&lt;/strong&gt; (Initial implementation)&lt;/li&gt;
&lt;li&gt;Learn more about event-driven and message system&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Knowledge-got&quot;&gt;&lt;a href=&quot;#Knowledge-got&quot; class=&quot;headerlink&quot; title=&quot;Knowledge got&quot;&gt;&lt;/a&gt;Knowledge got&lt;/h1&gt;&lt;p&gt;This week I’ve learned a lot!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Clustered Verticles and how to interact with each other&lt;/li&gt;
&lt;li&gt;Vert.x Event Bus (&lt;em&gt;send/recv&lt;/em&gt; and &lt;em&gt;pub/sub&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Vert.x Service Proxy&lt;/li&gt;
&lt;li&gt;More understanding about Redis(sorted set, list, pub/sub, transaction, etc)&lt;/li&gt;
&lt;li&gt;More understanding about asynchronous and reactive pattern(&lt;code&gt;Handler&lt;/code&gt; / &lt;code&gt;Future&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;How-to-implement-priority&quot;&gt;&lt;a href=&quot;#How-to-implement-priority&quot; class=&quot;headerlink&quot; title=&quot;How to implement priority?&quot;&gt;&lt;/a&gt;How to implement priority?&lt;/h2&gt;&lt;p&gt;I imitate Kue in Node.js: use &lt;strong&gt;sorted sets&lt;/strong&gt; in Redis and mark the priority as the score(weight). Use &lt;code&gt;zadd&lt;/code&gt; to add a certain id of job and when necessary, use &lt;code&gt;zpop&lt;/code&gt;(implemented with transaction) to get a job with higher priority.&lt;/p&gt;
&lt;h2 id=&quot;How-to-emit-and-receive-events&quot;&gt;&lt;a href=&quot;#How-to-emit-and-receive-events&quot; class=&quot;headerlink&quot; title=&quot;How to emit and receive events?&quot;&gt;&lt;/a&gt;How to emit and receive events?&lt;/h2&gt;&lt;p&gt;In Node.js, we could use &lt;code&gt;EventEmitter&lt;/code&gt; to emit and listen to events. And in Vert.x, we could make full use of &lt;code&gt;EventBus&lt;/code&gt;, which supports three kinds of pattern. For example, in Node.js we may write this:&lt;/p&gt;
&lt;figure class=&quot;highlight js&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;self.on(&lt;span class=&quot;string&quot;&gt;&#39;complete&#39;&lt;/span&gt;, fn);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// ......&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;self.emit(&lt;span class=&quot;string&quot;&gt;&#39;complete&#39;&lt;/span&gt;, res);&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;And in Vert.x we could write:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// listen to an address&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;eventBus.consumer(Kue.getHandlerAddress(&lt;span class=&quot;string&quot;&gt;&quot;complete&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.type), message -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      completeHandler.handle(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; Job((JsonObject) message.body()));&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// send message to an address&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;eventBus.send(Kue.getHandlerAddress(&lt;span class=&quot;string&quot;&gt;&quot;complete&quot;&lt;/span&gt;, type), job.toJson());&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;h2 id=&quot;Refined-the-design-of-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Refined-the-design-of-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Refined the design of Vert.x Kue&quot;&gt;&lt;/a&gt;Refined the design of Vert.x Kue&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Kue&lt;/code&gt;: like the &lt;code&gt;Queue&lt;/code&gt; in Kue. We could &lt;code&gt;createJob&lt;/code&gt; and &lt;code&gt;process&lt;/code&gt; the job&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueVerticle&lt;/code&gt;: a verticle where the &lt;code&gt;KueService&lt;/code&gt; is registered&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueWorker&lt;/code&gt;: a worker verticle that processes the job&lt;/li&gt;
&lt;li&gt;&lt;code&gt;KueService&lt;/code&gt;: create &lt;code&gt;KueWorker&lt;/code&gt; and deploy it&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Job&lt;/code&gt;: the job entity, contains numerous logic about job&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The backend of Vert.x Kue is &lt;strong&gt;Redis&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Basic usage (design) of Vert.x Kue:&lt;/p&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;18&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;19&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;20&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;21&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;22&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;23&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;24&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;25&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;26&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;27&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;28&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;29&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;30&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;31&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// write this and then run with Vert.x Launcher in clustered mode&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;ExampleProcessVerticle&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;AbstractVerticle&lt;/span&gt; &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;meta&quot;&gt;@Override&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;throws&lt;/span&gt; Exception &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;comment&quot;&gt;// must first create kue&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    Kue kue = Kue.createQueue(vertx, config());&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    Job job0 = kue.createJob(&lt;span class=&quot;string&quot;&gt;&quot;video&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; JsonObject().put(&lt;span class=&quot;string&quot;&gt;&quot;id&quot;&lt;/span&gt;, &lt;span class=&quot;number&quot;&gt;3001&lt;/span&gt;))&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      .priority(Priority.HIGH)&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      .onComplete(e -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        System.out.println(&lt;span class=&quot;string&quot;&gt;&quot;Video result: &quot;&lt;/span&gt; + e.getResult());&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        System.out.println(&lt;span class=&quot;string&quot;&gt;&quot;Haha&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    job0.save();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    kue.process(&lt;span class=&quot;string&quot;&gt;&quot;video&quot;&lt;/span&gt;, &lt;span class=&quot;number&quot;&gt;1&lt;/span&gt;, r -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; (r.succeeded()) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        Job job = r.result();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;comment&quot;&gt;// consume 2 seconds&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        vertx.setTimer(&lt;span class=&quot;number&quot;&gt;2000&lt;/span&gt;, l -&amp;gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;          job.progress(&lt;span class=&quot;number&quot;&gt;100&lt;/span&gt;, &lt;span class=&quot;number&quot;&gt;100&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;          System.out.println(&lt;span class=&quot;string&quot;&gt;&quot;Video id: &quot;&lt;/span&gt; + job.getId());&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125; &lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        r.cause().printStackTrace();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;h2 id=&quot;Initial-concept-implementation-of-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Initial-concept-implementation-of-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Initial concept implementation of Vert.x Kue&quot;&gt;&lt;/a&gt;Initial concept implementation of Vert.x Kue&lt;/h2&gt;&lt;p&gt;See here:  &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-job-queue/tree/initial-work&quot;&gt;sczyh30/vertx-blueprint-job-queue&lt;/a&gt;&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Work Period | Week 1</title>
    <link href="http://www.sczyh30.com/en/2016/05/29/gsoc-2016-work-period-week-1/"/>
    <id>http://www.sczyh30.com/en/2016/05/29/gsoc-2016-work-period-week-1/</id>
    <published>2016-05-28T16:00:00.000Z</published>
    <updated>2016-06-06T11:42:38.055Z</updated>
    
    <content type="html">&lt;p&gt;&lt;img src=&quot;http://vertx.io/assets/logo-sm.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This is the summary of Google Summer Of Code 2016, Week One.&lt;/p&gt;
&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Refine the code and document of &lt;strong&gt;Vert.x Blueprint - Todo Backend&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Work on the Vert.x Blueprint - Kue (Basic Design)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;How-to-use-Vert-x-Codegen-with-Gradle&quot;&gt;&lt;a href=&quot;#How-to-use-Vert-x-Codegen-with-Gradle&quot; class=&quot;headerlink&quot; title=&quot;How to use Vert.x Codegen with Gradle&quot;&gt;&lt;/a&gt;How to use Vert.x Codegen with Gradle&lt;/h2&gt;&lt;p&gt;We need to understand the essence of Vert.x Codegen - an APT(annotation processing tool), so we could write a task to do processing:&lt;/p&gt;
&lt;figure class=&quot;highlight gradle&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;task&lt;/span&gt; annotationProcessing(type: JavaCompile, &lt;span class=&quot;keyword&quot;&gt;group&lt;/span&gt;: &lt;span class=&quot;string&quot;&gt;&#39;build&#39;&lt;/span&gt;) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;source&lt;/span&gt; = &lt;span class=&quot;keyword&quot;&gt;sourceSets&lt;/span&gt;.main.java&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;classpath&lt;/span&gt; = &lt;span class=&quot;keyword&quot;&gt;configurations&lt;/span&gt;.&lt;span class=&quot;keyword&quot;&gt;compile&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;destinationDir&lt;/span&gt; = &lt;span class=&quot;keyword&quot;&gt;project&lt;/span&gt;.&lt;span class=&quot;keyword&quot;&gt;file&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;src/main/generated&#39;&lt;/span&gt;)&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;options&lt;/span&gt;.compilerArgs = [&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;string&quot;&gt;&quot;-proc:only&quot;&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;string&quot;&gt;&quot;-processor&quot;&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&quot;io.vertx.codegen.CodeGenProcessor&quot;&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;string&quot;&gt;&quot;-AoutputDirectory=$&amp;#123;project.projectDir&amp;#125;/src/main&quot;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  ]&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;And in &lt;code&gt;compileJava&lt;/code&gt; we reference the &lt;code&gt;annotationProcessing&lt;/code&gt; task:&lt;/p&gt;
&lt;figure class=&quot;highlight gradle&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;compileJava &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;targetCompatibility&lt;/span&gt; = &lt;span class=&quot;number&quot;&gt;1.8&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;sourceCompatibility&lt;/span&gt; = &lt;span class=&quot;number&quot;&gt;1.8&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  dependsOn annotationProcessing&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;sourceSets&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  main &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    java &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      srcDirs += &lt;span class=&quot;string&quot;&gt;&#39;src/main/generated&#39;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;Then we could process the annotations with Gradle~&lt;/p&gt;
&lt;p&gt;The Chinese version is here: &lt;a href=&quot;http://www.sczyh30.com/posts/Develop/gradle-annotation-processing-vertx-codegen/&quot;&gt;在 Gradle 中使用Annotation Processing Tool | Vert.x Codegen 示例&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;p&gt;Because there were many temporary experiments last week, I didn’t work during Friday to Sunday. Here are achievements of this week:&lt;/p&gt;
&lt;h2 id=&quot;Finished-the-Vert-x-Blueprint-Todo-Backend-project&quot;&gt;&lt;a href=&quot;#Finished-the-Vert-x-Blueprint-Todo-Backend-project&quot; class=&quot;headerlink&quot; title=&quot;Finished the Vert.x Blueprint - Todo Backend project&quot;&gt;&lt;/a&gt;Finished the &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-todo-backend&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Vert.x Blueprint - Todo Backend&lt;/a&gt; project&lt;/h2&gt;&lt;h2 id=&quot;Basic-design-of-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Basic-design-of-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Basic design of Vert.x Kue&quot;&gt;&lt;/a&gt;Basic design of Vert.x Kue&lt;/h2&gt;&lt;p&gt;In &lt;strong&gt;Kue&lt;/strong&gt;(Node.js), we use &lt;code&gt;kue.createQueue()&lt;/code&gt; to create a &lt;code&gt;Kue&lt;/code&gt; instance and then use &lt;code&gt;create(type, data)&lt;/code&gt; to create a job and then save the job to &lt;strong&gt;Redis&lt;/strong&gt;. After that, we invoke &lt;code&gt;job.process(type, callback)&lt;/code&gt; to process the job.&lt;/p&gt;
&lt;p&gt;And in my design of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;, I designed a &lt;code&gt;KueService&lt;/code&gt; that provide basic functions and wrapped a class &lt;code&gt;Kue&lt;/code&gt; like Queue in Node.js version. I use Vert.x Service Proxy and register it to a &lt;code&gt;KueVerticle&lt;/code&gt;. Our user could create a custom verticle(e.g. &lt;code&gt;ExampleVerticle&lt;/code&gt;) and create and process jon via &lt;code&gt;Kue&lt;/code&gt; class.&lt;/p&gt;
&lt;p&gt;As for processing jobs, I’m planning to use &lt;strong&gt;Worker Verticles&lt;/strong&gt; or just use &lt;code&gt;executeBlocking&lt;/code&gt; method.&lt;/p&gt;
&lt;h2 id=&quot;Learned-something-about-Microservice&quot;&gt;&lt;a href=&quot;#Learned-something-about-Microservice&quot; class=&quot;headerlink&quot; title=&quot;Learned something about Microservice&quot;&gt;&lt;/a&gt;Learned something about Microservice&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Microservice patterns(Quorum, Circuit Breaker Pattern, Compensating Transaction Pattern, etc.)&lt;/li&gt;
&lt;li&gt;Usage and reactive thoughts of &lt;strong&gt;Netflix Hystrix&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;http://vertx.io/assets/logo-sm.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This is the summary of Google Summer Of Code 2016, Week One.&lt;/p&gt;
&lt;h1 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h1&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Refine the code and document of &lt;strong&gt;Vert.x Blueprint - Todo Backend&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Work on the Vert.x Blueprint - Kue (Basic Design)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h1&gt;&lt;h2 id=&quot;How-to-use-Vert-x-Codegen-with-Gradle&quot;&gt;&lt;a href=&quot;#How-to-use-Vert-x-Codegen-with-Gradle&quot; class=&quot;headerlink&quot; title=&quot;How to use Vert.x Codegen with Gradle&quot;&gt;&lt;/a&gt;How to use Vert.x Codegen with Gradle&lt;/h2&gt;&lt;p&gt;We need to understand the essence of Vert.x Codegen - an APT(annotation processing tool), so we could write a task to do processing:&lt;/p&gt;
&lt;figure class=&quot;highlight gradle&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;task&lt;/span&gt; annotationProcessing(type: JavaCompile, &lt;span class=&quot;keyword&quot;&gt;group&lt;/span&gt;: &lt;span class=&quot;string&quot;&gt;&#39;build&#39;&lt;/span&gt;) &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;source&lt;/span&gt; = &lt;span class=&quot;keyword&quot;&gt;sourceSets&lt;/span&gt;.main.java&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;classpath&lt;/span&gt; = &lt;span class=&quot;keyword&quot;&gt;configurations&lt;/span&gt;.&lt;span class=&quot;keyword&quot;&gt;compile&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;destinationDir&lt;/span&gt; = &lt;span class=&quot;keyword&quot;&gt;project&lt;/span&gt;.&lt;span class=&quot;keyword&quot;&gt;file&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;src/main/generated&#39;&lt;/span&gt;)&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;options&lt;/span&gt;.compilerArgs = [&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;string&quot;&gt;&quot;-proc:only&quot;&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;string&quot;&gt;&quot;-processor&quot;&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&quot;io.vertx.codegen.CodeGenProcessor&quot;&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;string&quot;&gt;&quot;-AoutputDirectory=$&amp;#123;project.projectDir&amp;#125;/src/main&quot;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  ]&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;And in &lt;code&gt;compileJava&lt;/code&gt; we reference the &lt;code&gt;annotationProcessing&lt;/code&gt; task:&lt;/p&gt;
&lt;figure class=&quot;highlight gradle&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;compileJava &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;targetCompatibility&lt;/span&gt; = &lt;span class=&quot;number&quot;&gt;1.8&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;keyword&quot;&gt;sourceCompatibility&lt;/span&gt; = &lt;span class=&quot;number&quot;&gt;1.8&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  dependsOn annotationProcessing&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;sourceSets&lt;/span&gt; &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  main &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    java &amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;      srcDirs += &lt;span class=&quot;string&quot;&gt;&#39;src/main/generated&#39;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;  &amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;Then we could process the annotations with Gradle~&lt;/p&gt;
&lt;p&gt;The Chinese version is here: &lt;a href=&quot;http://www.sczyh30.com/posts/Develop/gradle-annotation-processing-vertx-codegen/&quot;&gt;在 Gradle 中使用Annotation Processing Tool | Vert.x Codegen 示例&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h1&gt;&lt;p&gt;Because there were many temporary experiments last week, I didn’t work during Friday to Sunday. Here are achievements of this week:&lt;/p&gt;
&lt;h2 id=&quot;Finished-the-Vert-x-Blueprint-Todo-Backend-project&quot;&gt;&lt;a href=&quot;#Finished-the-Vert-x-Blueprint-Todo-Backend-project&quot; class=&quot;headerlink&quot; title=&quot;Finished the Vert.x Blueprint - Todo Backend project&quot;&gt;&lt;/a&gt;Finished the &lt;a href=&quot;https://github.com/sczyh30/vertx-blueprint-todo-backend&quot;&gt;Vert.x Blueprint - Todo Backend&lt;/a&gt; project&lt;/h2&gt;&lt;h2 id=&quot;Basic-design-of-Vert-x-Kue&quot;&gt;&lt;a href=&quot;#Basic-design-of-Vert-x-Kue&quot; class=&quot;headerlink&quot; title=&quot;Basic design of Vert.x Kue&quot;&gt;&lt;/a&gt;Basic design of Vert.x Kue&lt;/h2&gt;&lt;p&gt;In &lt;strong&gt;Kue&lt;/strong&gt;(Node.js), we use &lt;code&gt;kue.createQueue()&lt;/code&gt; to create a &lt;code&gt;Kue&lt;/code&gt; instance and then use &lt;code&gt;create(type, data)&lt;/code&gt; to create a job and then save the job to &lt;strong&gt;Redis&lt;/strong&gt;. After that, we invoke &lt;code&gt;job.process(type, callback)&lt;/code&gt; to process the job.&lt;/p&gt;
&lt;p&gt;And in my design of &lt;strong&gt;Vert.x Kue&lt;/strong&gt;, I designed a &lt;code&gt;KueService&lt;/code&gt; that provide basic functions and wrapped a class &lt;code&gt;Kue&lt;/code&gt; like Queue in Node.js version. I use Vert.x Service Proxy and register it to a &lt;code&gt;KueVerticle&lt;/code&gt;. Our user could create a custom verticle(e.g. &lt;code&gt;ExampleVerticle&lt;/code&gt;) and create and process jon via &lt;code&gt;Kue&lt;/code&gt; class.&lt;/p&gt;
&lt;p&gt;As for processing jobs, I’m planning to use &lt;strong&gt;Worker Verticles&lt;/strong&gt; or just use &lt;code&gt;executeBlocking&lt;/code&gt; method.&lt;/p&gt;
&lt;h2 id=&quot;Learned-something-about-Microservice&quot;&gt;&lt;a href=&quot;#Learned-something-about-Microservice&quot; class=&quot;headerlink&quot; title=&quot;Learned something about Microservice&quot;&gt;&lt;/a&gt;Learned something about Microservice&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Microservice patterns(Quorum, Circuit Breaker Pattern, Compensating Transaction Pattern, etc.)&lt;/li&gt;
&lt;li&gt;Usage and reactive thoughts of &lt;strong&gt;Netflix Hystrix&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>GSoC 2016 | Vert.x | Community Bonding Period</title>
    <link href="http://www.sczyh30.com/en/2016/05/22/gsoc-2016-community-bonding/"/>
    <id>http://www.sczyh30.com/en/2016/05/22/gsoc-2016-community-bonding/</id>
    <published>2016-05-21T16:00:00.000Z</published>
    <updated>2016-06-06T11:24:15.736Z</updated>
    
    <content type="html">&lt;p&gt;In this blog I’ll summarize the four weeks during the Community Bonding Period of GSoC 2016 :)&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
&lt;h1 id=&quot;Week-1&quot;&gt;&lt;a href=&quot;#Week-1&quot; class=&quot;headerlink&quot; title=&quot;Week 1&quot;&gt;&lt;/a&gt;Week 1&lt;/h1&gt;&lt;p&gt;The stuff of the first week:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make contact with my mentors&lt;/li&gt;
&lt;li&gt;Set up development environment&lt;/li&gt;
&lt;li&gt;Do more research on my project&lt;/li&gt;
&lt;li&gt;Read more documents and articles about Vert.x&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Week-2&quot;&gt;&lt;a href=&quot;#Week-2&quot; class=&quot;headerlink&quot; title=&quot;Week 2&quot;&gt;&lt;/a&gt;Week 2&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Discuss with mentors to refine my summer timeline and prepare a good project plan&lt;/li&gt;
&lt;li&gt;Translate the document of &lt;code&gt;Vert.x - From zero to (micro)-hero&lt;/code&gt; Microservice Lab into Chinese(a wonderful lab!)&lt;/li&gt;
&lt;li&gt;Learn more about various components of Vert.x&lt;/li&gt;
&lt;li&gt;Work on &lt;em&gt;Vert.x Blueprint - Todo Backend&lt;/em&gt;, use multiple persistence&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Week-3&quot;&gt;&lt;a href=&quot;#Week-3&quot; class=&quot;headerlink&quot; title=&quot;Week 3&quot;&gt;&lt;/a&gt;Week 3&lt;/h1&gt;&lt;h3 id=&quot;Objectives&quot;&gt;&lt;a href=&quot;#Objectives&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Refine project plan&lt;/li&gt;
&lt;li&gt;Work on the English document of &lt;em&gt;Vert.x Blueprint - Todo Backend&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Refine the code and document of &lt;em&gt;Vert.x Blueprint - Todo Backend&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Learn more about &lt;code&gt;EventBus&lt;/code&gt; and Vert.x Service Proxy&lt;/li&gt;
&lt;li&gt;Design the structure of &lt;em&gt;Vert.x Blueprint - Kue&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Initial structure of &lt;em&gt;Vert.x Blueprint - Kue&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;Issues&quot;&gt;&lt;a href=&quot;#Issues&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;I viewed the code of Kue (Node.js version) and find it weird. Maybe I could write a &lt;code&gt;Kue&lt;/code&gt; class referring to the encapsulation of &lt;code&gt;KueVerticle&lt;/code&gt;. Every components of the Kue could use &lt;code&gt;EventBus&lt;/code&gt; to interact with each other.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;Week-4&quot;&gt;&lt;a href=&quot;#Week-4&quot; class=&quot;headerlink&quot; title=&quot;Week 4&quot;&gt;&lt;/a&gt;Week 4&lt;/h1&gt;&lt;h3 id=&quot;Objectives-1&quot;&gt;&lt;a href=&quot;#Objectives-1&quot; class=&quot;headerlink&quot; title=&quot;Objectives&quot;&gt;&lt;/a&gt;Objectives&lt;/h3&gt;&lt;p&gt;In this week, I’m planning to do the following stuff:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finish Chinese version document of Todo Backend&lt;/li&gt;
&lt;li&gt;Work on the Vert.x Blueprint - Kue (Initial implementation)&lt;/li&gt;
&lt;li&gt;Learn from Kue’s design&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;Issues-1&quot;&gt;&lt;a href=&quot;#Issues-1&quot; class=&quot;headerlink&quot; title=&quot;Issues&quot;&gt;&lt;/a&gt;Issues&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Solved: How to use Vert.x Codegen in Gradle (for the lack of document)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;Achievement&quot;&gt;&lt;a href=&quot;#Achievement&quot; class=&quot;headerlink&quot; title=&quot;Achievement&quot;&gt;&lt;/a&gt;Achievement&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Learned something about Kue’s design&lt;/li&gt;
&lt;li&gt;Refactored some of &lt;em&gt;Vert.x Blueprint - Todo Backend&lt;/em&gt; code&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;@DataObject&lt;/code&gt; annotation to generate converter&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Docker Compose&lt;/strong&gt; to link two containers&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Vert.x Launcher&lt;/strong&gt; and read configure from json file&lt;/li&gt;
&lt;li&gt;Resolve the id issue using &lt;em&gt;incremental id&lt;/em&gt; (like auto_incr in db)&lt;/li&gt;
&lt;li&gt;Remove redundant code&lt;/li&gt;
&lt;li&gt;Update some part of documents&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Community Bonding Period is ending and the code period will be coming~ Exciting! Wish an amazing code summer with Vert.x!&lt;/p&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;In this blog I’ll summarize the four weeks during the Community Bonding Period of GSoC 2016 :)&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>Working on GSoC 2016 with Vert.x Community</title>
    <link href="http://www.sczyh30.com/en/2016/04/29/working-on-gsoc-2016-with-vertx/"/>
    <id>http://www.sczyh30.com/en/2016/04/29/working-on-gsoc-2016-with-vertx/</id>
    <published>2016-04-28T16:00:00.000Z</published>
    <updated>2016-05-16T16:42:26.177Z</updated>
    
    <content type="html">&lt;p&gt;Exciting! I have been accepted for Google Summer of Code 2016 with Vert.x Community. My project is &lt;strong&gt;Vert.x Blueprint&lt;/strong&gt;. Looking forward to an amazing summer with Vert.x~~&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
&lt;h1 id=&quot;About-my-project&quot;&gt;&lt;a href=&quot;#About-my-project&quot; class=&quot;headerlink&quot; title=&quot;About my project&quot;&gt;&lt;/a&gt;About my project&lt;/h1&gt;&lt;p&gt;Vert.x is an excellent full-stack toolkit which can help us build FRP-sytle, high concurrent, scalable applications. And I hope more developers could make full use of Vert.x to build their applications rapidly and concisely. So it is necessary to implement a series of applications using various part of the Vert.x toolkit to demonstrate the ability to build many kinds of applications.&lt;/p&gt;
&lt;p&gt;My goal is to implement some different applications using Vert.x and write detailed documents (both in English and Simplified Chinese) as guideline for the newcomer to Vert.x in order to help them understand the foundations of a vert.x application rapidly and then build complex applications. If time is permitted, I am willing to contribute to Vert.x Microservice Tools or Vert.x Scala Version~&lt;/p&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;Exciting! I have been accepted for Google Summer of Code 2016 with Vert.x Community. My project is &lt;strong&gt;Vert.x Blueprint&lt;/strong&gt;. Looking forward to an amazing summer with Vert.x~~&lt;/p&gt;
    
    </summary>
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/categories/GSoC-2016/"/>
    
    
      <category term="GSoC 2016" scheme="http://www.sczyh30.com/en/tags/GSoC-2016/"/>
    
      <category term="Vert.x" scheme="http://www.sczyh30.com/en/tags/Vert-x/"/>
    
  </entry>
  
  <entry>
    <title>My new blog in English</title>
    <link href="http://www.sczyh30.com/en/2016/04/26/new-english-blog/"/>
    <id>http://www.sczyh30.com/en/2016/04/26/new-english-blog/</id>
    <published>2016-04-25T16:00:00.000Z</published>
    <updated>2016-05-16T15:55:50.765Z</updated>
    
    <content type="html">&lt;p&gt;&lt;strong&gt;A blog in English independently is very necessary!&lt;/strong&gt;&lt;/p&gt;
&lt;a id=&quot;more&quot;&gt;&lt;/a&gt;
&lt;p&gt;This time I chose a concise and beautiful theme, &lt;a href=&quot;https://github.com/pinggod/hexo-theme-apollo&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Apollo&lt;/a&gt;. I love this theme~~&lt;/p&gt;
&lt;h1 id=&quot;Tip-Test&quot;&gt;&lt;a href=&quot;#Tip-Test&quot; class=&quot;headerlink&quot; title=&quot;Tip Test&quot;&gt;&lt;/a&gt;Tip Test&lt;/h1&gt;&lt;div class=&quot;tip&quot;&gt;&lt;br&gt;    Note: This tip is only for font test!&lt;br&gt;    仅供测试字体使用。&lt;br&gt;&lt;/div&gt;
</content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;strong&gt;A blog in English independently is very necessary!&lt;/strong&gt;&lt;/p&gt;
    
    </summary>
    
    
  </entry>
  
</feed>
