|
27 | 27 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
28 | 28 |
|
29 | 29 | /** |
30 | | - * With the Microservices pattern, a client may need data from multiple different microservices. |
31 | | - * If the client called each microservice directly, that could contribute to longer load times, |
32 | | - * since the client would have to make a network request for each microservice called. Moreover, |
33 | | - * having the client call each microservice directly ties the client to that microservice - if the |
34 | | - * internal implementations of the microservices change (for example, if two microservices are |
35 | | - * combined sometime in the future) or if the location (host and port) of a microservice changes, |
36 | | - * then every client that makes use of those microservices must be updated. |
| 30 | + * With the Microservices pattern, a client may need data from multiple different microservices. If |
| 31 | + * the client called each microservice directly, that could contribute to longer load times, since |
| 32 | + * the client would have to make a network request for each microservice called. Moreover, having |
| 33 | + * the client call each microservice directly ties the client to that microservice - if the internal |
| 34 | + * implementations of the microservices change (for example, if two microservices are combined |
| 35 | + * sometime in the future) or if the location (host and port) of a microservice changes, then every |
| 36 | + * client that makes use of those microservices must be updated. |
37 | 37 | * |
38 | | - * <p> |
39 | | - * The intent of the API Gateway pattern is to alleviate some of these issues. In the API Gateway |
40 | | - * pattern, an additional entity (the API Gateway) is placed between the client and the |
41 | | - * microservices. The job of the API Gateway is to aggregate the calls to the microservices. |
42 | | - * Rather than the client calling each microservice individually, the client calls the API Gateway |
43 | | - * a single time. The API Gateway then calls each of the microservices that the client needs. |
| 38 | + * <p>The intent of the API Gateway pattern is to alleviate some of these issues. In the API |
| 39 | + * Gateway pattern, an additional entity (the API Gateway) is placed between the client and the |
| 40 | + * microservices. The job of the API Gateway is to aggregate the calls to the microservices. Rather |
| 41 | + * than the client calling each microservice individually, the client calls the API Gateway a single |
| 42 | + * time. The API Gateway then calls each of the microservices that the client needs. |
44 | 43 | * |
45 | | - * <p> |
46 | | - * This implementation shows what the API Gateway pattern could look like for an e-commerce site. |
47 | | - * The {@link ApiGateway} makes calls to the Image and Price microservices using the |
48 | | - * {@link ImageClientImpl} and {@link PriceClientImpl} respectively. Customers viewing the site on a |
49 | | - * desktop device can see both price information and an image of a product, so the {@link ApiGateway} |
50 | | - * calls both of the microservices and aggregates the data in the {@link DesktopProduct} model. |
51 | | - * However, mobile users only see price information; they do not see a product image. For mobile |
52 | | - * users, the {@link ApiGateway} only retrieves price information, which it uses to populate the |
53 | | - * {@link MobileProduct}. |
| 44 | + * <p>This implementation shows what the API Gateway pattern could look like for an e-commerce |
| 45 | + * site. The {@link ApiGateway} makes calls to the Image and Price microservices using the {@link |
| 46 | + * ImageClientImpl} and {@link PriceClientImpl} respectively. Customers viewing the site on a |
| 47 | + * desktop device can see both price information and an image of a product, so the {@link |
| 48 | + * ApiGateway} calls both of the microservices and aggregates the data in the {@link DesktopProduct} |
| 49 | + * model. However, mobile users only see price information; they do not see a product image. For |
| 50 | + * mobile users, the {@link ApiGateway} only retrieves price information, which it uses to populate |
| 51 | + * the {@link MobileProduct}. |
54 | 52 | */ |
55 | 53 | @SpringBootApplication |
56 | 54 | public class App { |
57 | 55 |
|
58 | 56 | /** |
59 | | - * Program entry point |
| 57 | + * Program entry point. |
60 | 58 | * |
61 | | - * @param args |
62 | | - * command line args |
| 59 | + * @param args command line args |
63 | 60 | */ |
64 | 61 | public static void main(String[] args) { |
65 | 62 | SpringApplication.run(App.class, args); |
|
0 commit comments