Skip to content

Commit b1a0b02

Browse files
author
Ivan Franchin
committed
project update
- update to spring-boot 2.5.1; - update to jib 3.1.1; - add remove-docker-images.sh; - disable swagger petstore sample; - update README.
1 parent 0747c56 commit b1a0b02

File tree

5 files changed

+105
-62
lines changed

5 files changed

+105
-62
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
*.DS_Store
2-
31
target/
42
!.mvn/wrapper/maven-wrapper.jar
53
!**/src/main/**/target/
@@ -32,3 +30,6 @@ build/
3230

3331
### VS Code ###
3432
.vscode/
33+
34+
### MAC OS ###
35+
*.DS_Store

README.adoc

+94-58
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The goal of this project is to implement an application called `product-app`. It
3131
docker-compose up -d
3232
----
3333

34-
* Wait until the `Elasticsearch` docker container is up and healthy. To check it, run
34+
* Wait until `Elasticsearch` docker container is up and healthy. To check it, run
3535
+
3636
[source]
3737
----
@@ -199,6 +199,11 @@ image::images/demo-user-interaction.gif[]
199199
----
200200
docker-compose down -v
201201
----
202+
* To remove the Docker images created by this project, run
203+
[source]
204+
----
205+
./remove-docker-images.sh
206+
----
202207

203208
== Creating indexes and reindexing them using Elasticsearch REST API
204209

@@ -218,17 +223,17 @@ It should return something like
218223
[source]
219224
----
220225
{
221-
"name" : "fadee0b011b7",
226+
"name" : "e7f07cc75f5c",
222227
"cluster_name" : "docker-es-cluster",
223-
"cluster_uuid" : "iO1Ne0WXRDeQYZyGp3DaWQ",
228+
"cluster_uuid" : "RthzZuf2QHKxPX--9cLWtg",
224229
"version" : {
225-
"number" : "7.6.2",
226-
"build_flavor" : "oss",
230+
"number" : "7.12.1",
231+
"build_flavor" : "default",
227232
"build_type" : "docker",
228-
"build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
229-
"build_date" : "2020-03-26T06:34:37.794943Z",
233+
"build_hash" : "3186837139b9c6b6d23c3200870651f10d3343b7",
234+
"build_date" : "2021-04-20T20:56:39.040728659Z",
230235
"build_snapshot" : false,
231-
"lucene_version" : "8.4.0",
236+
"lucene_version" : "8.8.0",
232237
"minimum_wire_compatibility_version" : "6.8.0",
233238
"minimum_index_compatibility_version" : "6.0.0-beta1"
234239
},
@@ -247,7 +252,7 @@ It should return
247252
+
248253
[source]
249254
----
250-
{ "acknowledged":true, "shards_acknowledged":true, "index":"ecommerce.products.v1" }
255+
{"acknowledged":true,"shards_acknowledged":true,"index":"ecommerce.products.v1"}
251256
----
252257

253258
* Check indexes
@@ -262,7 +267,7 @@ It should return something like
262267
[source]
263268
----
264269
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
265-
yellow open ecommerce.products.v1 1B3JXm6zQnKolob4mtwRUg 1 1 0 0 230b 230b
270+
yellow open ecommerce.products.v1 1cgjRUxQQVW_uFfc3nYFcg 1 1 0 0 208b 208b
266271
----
267272

268273
* Check `ecommerce.products.v1` index mapping
@@ -277,20 +282,40 @@ It should return
277282
[source]
278283
----
279284
{
280-
"ecommerce.products.v1": {
281-
"mappings": {
282-
"properties": {
283-
"categories": { "type": "keyword" },
284-
"created": { "type": "date", "format": "strict_date_time_no_millis||yyyy-MM-dd'T'HH:mmZZ" },
285-
"description": { "type": "text" },
286-
"name": { "type": "text" },
287-
"price": { "type": "float" },
288-
"reference": { "type": "text" },
289-
"reviews": {
290-
"properties": {
291-
"comment": { "type": "text" },
292-
"created": { "type": "date", "format": "strict_date_time_no_millis||yyyy-MM-dd'T'HH:mmZZ" },
293-
"stars": { "type": "short" }
285+
"ecommerce.products.v1" : {
286+
"mappings" : {
287+
"properties" : {
288+
"categories" : {
289+
"type" : "keyword"
290+
},
291+
"created" : {
292+
"type" : "date",
293+
"format" : "strict_date_time_no_millis||yyyy-MM-dd'T'HH:mmZZ"
294+
},
295+
"description" : {
296+
"type" : "text"
297+
},
298+
"name" : {
299+
"type" : "text"
300+
},
301+
"price" : {
302+
"type" : "float"
303+
},
304+
"reference" : {
305+
"type" : "text"
306+
},
307+
"reviews" : {
308+
"properties" : {
309+
"comment" : {
310+
"type" : "text"
311+
},
312+
"created" : {
313+
"type" : "date",
314+
"format" : "strict_date_time_no_millis||yyyy-MM-dd'T'HH:mmZZ"
315+
},
316+
"stars" : {
317+
"type" : "short"
318+
}
294319
}
295320
}
296321
}
@@ -304,14 +329,14 @@ It should return
304329
[source]
305330
----
306331
curl -X POST localhost:9200/_aliases -H 'Content-Type: application/json' \
307-
-d '{ "actions": [{ "add": {"alias": "ecommerce.products", "index": "ecommerce.products.v1" }}]}'
332+
-d '{ "actions": [{ "add": {"alias": "ecommerce.products", "index": "ecommerce.products.v1" }}]}'
308333
----
309334
+
310335
It should return
311336
+
312337
[source]
313338
----
314-
{ "acknowledged":true }
339+
{"acknowledged":true}
315340
----
316341

317342
* Check aliases
@@ -325,7 +350,13 @@ It should return
325350
+
326351
[source]
327352
----
328-
{ "ecommerce.products.v1": { "aliases": { "ecommerce.products": {} } } }
353+
{
354+
"ecommerce.products.v1" : {
355+
"aliases" : {
356+
"ecommerce.products" : { }
357+
}
358+
}
359+
}
329360
----
330361

331362
* Create `ecommerce.products.v2` index
@@ -339,7 +370,7 @@ It should return
339370
+
340371
[source]
341372
----
342-
{ "acknowledged":true, "shards_acknowledged":true, "index":"ecommerce.products.v2" }
373+
{"acknowledged":true,"shards_acknowledged":true,"index":"ecommerce.products.v2"}
343374
----
344375
+
345376
Checking indexes again
@@ -354,8 +385,8 @@ It should return something like
354385
[source]
355386
----
356387
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
357-
yellow open ecommerce.products.v2 Iq0adLgEQSaCTIOISIW4DA 1 1 0 0 230b 230b
358-
yellow open ecommerce.products.v1 1B3JXm6zQnKolob4mtwRUg 1 1 0 0 283b 283b
388+
yellow open ecommerce.products.v2 yAC8FWpcRH28YkDux9EQYA 1 1 0 0 208b 208b
389+
yellow open ecommerce.products.v1 1cgjRUxQQVW_uFfc3nYFcg 1 1 0 0 208b 208b
359390
----
360391

361392
* Reindex from `ecommerce.products.v1` to `ecommerce.products.v2`
@@ -370,22 +401,7 @@ It should return something like
370401
+
371402
[source]
372403
----
373-
{
374-
"took": 86,
375-
"timed_out": false,
376-
"total": 0,
377-
"updated": 0,
378-
"created": 0,
379-
"deleted": 0,
380-
"batches": 0,
381-
"version_conflicts": 0,
382-
"noops": 0,
383-
"retries": { "bulk": 0, "search": 0 },
384-
"throttled_millis": 0,
385-
"requests_per_second": -1.0,
386-
"throttled_until_millis": 0,
387-
"failures": []
388-
}
404+
{"took":77,"timed_out":false,"total":0,"updated":0,"created":0,"deleted":0,"batches":0,"version_conflicts":0,"noops":0,"retries":{"bulk":0,"search":0},"throttled_millis":0,"requests_per_second":-1.0,"throttled_until_millis":0,"failures":[]}
389405
----
390406

391407
* Adjust alias after reindex from `ecommerce.products.v1` to `ecommerce.products.v2`
@@ -400,7 +416,7 @@ It should return
400416
+
401417
[source]
402418
----
403-
{ "acknowledged":true }
419+
{"acknowledged":true}
404420
----
405421
+
406422
Checking aliases again
@@ -415,8 +431,14 @@ It should return something like
415431
[source]
416432
----
417433
{
418-
"ecommerce.products.v1": { "aliases": {} },
419-
"ecommerce.products.v2": { "aliases": { "ecommerce.products": {} } }
434+
"ecommerce.products.v1" : {
435+
"aliases" : { }
436+
},
437+
"ecommerce.products.v2" : {
438+
"aliases" : {
439+
"ecommerce.products" : { }
440+
}
441+
}
420442
}
421443
----
422444

@@ -431,7 +453,7 @@ It should return
431453
+
432454
[source]
433455
----
434-
{ "acknowledged":true }
456+
{"acknowledged":true}
435457
----
436458
+
437459
Checking aliases again
@@ -445,7 +467,13 @@ It should return
445467
+
446468
[source]
447469
----
448-
{ "ecommerce.products.v2": { "aliases": { "ecommerce.products": {} } } }
470+
{
471+
"ecommerce.products.v2" : {
472+
"aliases" : {
473+
"ecommerce.products" : { }
474+
}
475+
}
476+
}
449477
----
450478

451479
* Simple search
@@ -460,13 +488,21 @@ It should return something like
460488
[source]
461489
----
462490
{
463-
"took": 1,
464-
"timed_out": false,
465-
"_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 },
466-
"hits": {
467-
"total": { "value": 0, "relation": "eq" },
468-
"max_score": null,
469-
"hits": []
491+
"took" : 14,
492+
"timed_out" : false,
493+
"_shards" : {
494+
"total" : 1,
495+
"successful" : 1,
496+
"skipped" : 0,
497+
"failed" : 0
498+
},
499+
"hits" : {
500+
"total" : {
501+
"value" : 0,
502+
"relation" : "eq"
503+
},
504+
"max_score" : null,
505+
"hits" : [ ]
470506
}
471507
}
472508
----

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.5.0</version>
8+
<version>2.5.1</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -19,7 +19,7 @@
1919
<properties>
2020
<java.version>11</java.version>
2121
<spring-cloud.version>2020.0.3</spring-cloud.version>
22-
<jib-maven-plugin.version>3.0.0</jib-maven-plugin.version>
22+
<jib-maven-plugin.version>3.1.1</jib-maven-plugin.version>
2323
<openjdk-image.version>11.0.11</openjdk-image.version>
2424
<docker-image.prefix>ivanfranchin</docker-image.prefix>
2525
</properties>

product-api/src/main/resources/application.properties

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ management.endpoint.health.show-details=always
88

99
springdoc.show-actuator=true
1010
springdoc.swagger-ui.groups-order=DESC
11+
springdoc.swagger-ui.disable-swagger-default-url=true
1112

1213
eureka.client.serviceUrl.defaultZone=http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8761}/eureka
1314
eureka.instance.preferIpAddress=true

remove-docker-images.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
docker rmi ivanfranchin/eureka-server:1.0.0
4+
docker rmi ivanfranchin/product-api:1.0.0
5+
docker rmi ivanfranchin/product-ui:1.0.0

0 commit comments

Comments
 (0)