forked from mudigal-technologies/microservices-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
189 lines (183 loc) · 13.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Vijayendra Mudigal">
<meta name="google-site-verification" content="GiqexfpO7sooBx0oISus1uZ8j06Hx43AUMP4cLeBSfI" />
<meta name="msvalidate.01" content="9867CE8A81DEE86E2DC183EAFF440D2E" />
<meta name="robots" content="index,follow">
<meta name="Googlebot" content="index,follow">
<meta name="description" content="A sample application to demonstrate microservices using SpringBoot">
<meta name="keywords" content="Zuul, Consul, Java, Maven, Git, AngularJS, JQuery, Docker, Dockerfile, Dockercompose, Microservices-architecture, API Gateway, Reverse Proxy, Elasticsearch,Logstash, Kibana, Weavescope, Springboot, Logback, RabbitMQ, MySQL, Database, Netflix OSS, Inverted Indexing, Microservice, Microservice Demo, Microservice Sample, Swagger, Service Registration, Service Discovery, Dozer, Dozer Mapping, DevTools, Actuator, Management API's, Health Check, AMPQ, Microservices Template">
<link rel="shortcut icon" type="image/png" href="about/img/favicon.ico">
<title>Microservices Sample</title>
<!-- Custom Fonts -->
<link href="https://fonts.googleapis.com/css?family=Sansita|Ubuntu"
rel="stylesheet">
<link
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<!-- Theme CSS -->
<link href="about/css/all.css" rel="stylesheet">
</head>
<body id="page-top">
<div class="container">
<header>
<div class="header-content">
<div class="header-content-inner">
<h1 style="font-size: 52px;">
Microservices Sample Project
<div style="float:right">
<script src="http://platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-url="http://vmudigal.github.io/microservices-sample/" data-counter="right"></script>
</div>
</h1>
</div>
</div>
</header>
<div class="readme boxed-group clearfix announce instapaper_body md">
<article class="markdown-body entry-content" itemprop="text">
<h3>
What is it?
</h3>
<p>"Microservices", a trending buzz word nowadays. What problems does it solve?</p>
<p>Many organizations nowadays are driving the technology migrations and one of the biggest challenges is to migrate from monolithic application to micro-services based application.</p>
<p>This mircoservices-sample project demonstrates how multiple services run independently leveraging on the best microservices patterns to enable scale, performance and resilience.</p>
<div>
Code Base: <a
href="https://github.com/vmudigal/microservices-sample"
target="_blank">https://github.com/vmudigal/microservices-sample</a>
</div>
<div class="video-container">
<iframe width="853" height="480" src="https://www.youtube.com/embed/AYcsnuIOW2M?rel=0&controls=0&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<h3>
Use case
</h3>
<p>The sample application has three services namely service-one, service-two and service-three. Each of the service has its own database service-one-db, service-two-db and service-three-db respectively. During the startup of the services, it persists the service name and an auto generated UUID in its perspective database and sends the data to the RabbitMQ exchange which then broadcasts the data to all the queues based on the routing key. Every microservices listens to its own RabbitMQ queue and keeps updating the database as and when it receives the data.</p>
<p>Below are the screens of the application.</p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/app-screens/01.%20Home.png?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/app-screens/01.%20Home.png?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<p>Click on one of the tab's (one, two or three) the data that you see on the screen is based on the data fetched by the respective service by calling its database.</p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/app-screens/02.%20One.png?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/app-screens/02.%20One.png?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<p>Notice that the UUID generated for service-one which lies in service-one-db is in sync with service-two and service-three tabs which is achieved by RabbitMQ (asychronous communication between microservices).</p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/app-screens/03.%20Two.png?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/app-screens/03.%20Two.png?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/app-screens/04.%20Three.png?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/app-screens/04.%20Three.png?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<h3>
Service Registration
</h3>
<p>During the initialization of a service, it would be registered to the discovery and registration server (which in our example is Hashicorp's Consul).</p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/sequence-diagram/microservices-sample%20(service%20registration%20sequence).png?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/sequence-diagram/microservices-sample%20(service%20registration%20sequence).png?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<h4>
Service Discovery
</h4>
<p>When one service (say api-gateway) needs to access a resource from another service (say service-one), all it has to do is ask discovery and registration server (Consul) to give one of the service-one's instance information.</p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/sequence-diagram/microservices-sample%20(service%20discovery%20sequence).png?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/sequence-diagram/microservices-sample%20(service%20discovery%20sequence).png?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<h3>
Architecture
</h3>
<p>Below is the architectural diagram for microservices sample project.</p>
<p><a href="https://github.com/vmudigal/microservices-sample/blob/master/documents/Architecture.jpg?raw=true" target="_blank"><img src="https://github.com/vmudigal/microservices-sample/raw/master/documents/Architecture.jpg?raw=true" alt="alt tag" style="max-width:100%;"></a></p>
<h3>
Technology
</h3>
<p>Microservices sample project uses a number of open source projects to work properly:</p>
<ul>
<li><a href="https://projects.spring.io/spring-boot/">SpringBoot</a> - Application framework</li>
<li><a href="https://github.com/Netflix/zuul/wiki">Zuul</a> - API Gateway (Load Balancer)</li>
<li><a href="https://www.consul.io">Consul</a> - Service registration and Discovery</li>
<li><a href="https://www.docker.com">Docker</a> - Containerization platform</li>
<li><a href="https://www.rabbitmq.com/">RabbitMQ</a> - asynchronous microservices messaging.</li>
<li><a href="https://www.elastic.co/products/logstash">Logstash</a> - Log collector</li>
<li><a href="https://www.elastic.co/products/elasticsearch">Elasticsearch</a> - Log indexer</li>
<li><a href="https://www.elastic.co/products/kibana">Kibana</a> - Data visualization</li>
<li><a href="http://angularjs.org">AngularJS</a> - HTML enhanced for web apps!</li>
<li><a href="http://twitter.github.com/bootstrap/">Bootstrap</a> - great UI boilerplate for modern web apps</li>
<li><a href="http://jquery.com">jQuery</a> - HTML document traversal and manipulation</li>
<li><a href="https://swagger.io/">Swagger</a> - API documentation</li>
</ul>
<h3>
<a id="user-content-tools" class="anchor" href="#tools" aria-hidden="true">
<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</svg>
</a>
Tools
</h3>
<ul>
<li><a href="https://go.java">Java</a> - Programming</li>
<li><a href="https://maven.apache.org">Maven</a> - Build</li>
<li><a href="https://git-scm.com">Git</a> - Version control</li>
<li><a href="https://www.docker.com">Docker</a> - Deployment</li>
</ul>
<h3>
Development
</h3>
<p>Below are the steps to bring up the development environment and get started.</p>
<ol>
<li>Install Git, Java, Maven and Docker<br></li>
<li>For the project using <a href="https://github.com/vmudigal/microservices-sample.git">https://github.com/vmudigal/microservices-sample.git</a></li>
<li>Clone the fork using <a href="https://github.com/%7BYOUR_GIT_ID%7D/microservices-sample.git">https://github.com/{YOUR_GIT_ID}/microservices-sample.git</a><br></li>
<li>Execute "cd /microservices-sample/build/docker/scripts/"<br></li>
<li>To deploy docker please run "./deploy.sh docker".<br></li>
<li>Access the Application at <a href="http://localhost/">http://localhost/</a><br><br></li>
</ol>
<h3>
Help
</h3>
<p>Feel free to reach "<a href="mailto:vijayendrap@gmail.com">vijayendrap@gmail.com</a>" incase of any concerns.</p>
<script src="https://cdn.bootcss.com/pdf.js/1.8.423/pdf.js"></script>
<script src="https://code.jquery.com/jquery-2.2.4.js" integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-browser/0.1.0/jquery.browser.js"></script>
<script type="text/javascript">
PDFJS.workerSrc = "https://cdn.bootcss.com/pdf.js/1.8.423/pdf.worker.js";
</script>
<script type="text/javascript">
function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1.0 };
function renderPage(page) {
var viewport = page.getViewport(options.scale);
if(jQuery.browser.desktop)
{
viewport = page.getViewport(1.8);
}
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var renderContext = {
canvasContext: ctx,
viewport: viewport
};
canvas.height = viewport.height;
canvas.width = viewport.width;
canvasContainer.appendChild(canvas);
page.render(renderContext);
}
function renderPages(pdfDoc) {
for(var num = 1; num <= pdfDoc.numPages; num++)
pdfDoc.getPage(num).then(renderPage);
}
PDFJS.disableWorker = true;
PDFJS.getDocument(url).then(renderPages);
}
</script>
<div id="componentsPDF" style="width:100%; height:100%"></div>
<script type="text/javascript">
renderPDF('https://raw.githubusercontent.com/vmudigal/microservices-sample/31b4e280c65bf31fd73e0b9a9fec3adbe451e673/documents/Components.pdf', document.getElementById('componentsPDF'));
</script>
<!-- Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-100654918-1', 'auto');
ga('send', 'pageview');
</script>
</article>
</div>
</div>
</body>
</html>