@@ -34,11 +34,11 @@ Map<String, String> healthz() {
34
34
@ PostMapping (path = "/rent" , consumes = "application/json" , produces = "application/json" )
35
35
List <String > rent (@ RequestBody Rent rentInput ) {
36
36
String catalogID = rentInput .getMovieID ();
37
- String price = rentInput .getPrice ();
37
+ Double price = rentInput .getPrice ();
38
38
39
39
logger .info ("Rent [{},{}] received" , catalogID , price );
40
40
41
- kafkaTemplate .send (KAFKA_TOPIC_RENTALS , catalogID , price )
41
+ kafkaTemplate .send (KAFKA_TOPIC_RENTALS , catalogID , price . toString () )
42
42
.thenAccept (result -> logger .info ("Message [{}] delivered with offset {}" ,
43
43
catalogID ,
44
44
result .getRecordMetadata ().offset ()))
@@ -72,7 +72,7 @@ public Map<String, String> returnMovie(@RequestBody ReturnRequest returnRequest)
72
72
public static class Rent {
73
73
@ JsonProperty ("catalog_id" )
74
74
private String movieID ;
75
- private String price ;
75
+ private Double price ;
76
76
77
77
public void setMovieID (String movieID ) {
78
78
this .movieID = movieID ;
@@ -83,11 +83,11 @@ public String getMovieID() {
83
83
}
84
84
85
85
86
- public void setPrice (String price ) {
86
+ public void setPrice (Double price ) {
87
87
this .price = price ;
88
88
}
89
89
90
- public String getPrice () {
90
+ public Double getPrice () {
91
91
return price ;
92
92
}
93
93
}
0 commit comments