<commit_before># Zuul proxy microservice
Examples of microservice instrastructures: Zuul proxy

## Blog post
For this example, a Zuul proxy used as edge service will be incorporated.
Explanation of the architecture and purpose of having a Zuul proxy:
http://www.josedab.com/2016/03/01/microservices-using-zuul-proxy-as-a-micro-proxy-and-api-gateway/

## Overview
Zuul service proxying GET and POST requests. 
On top of proxying requests, distributed messaging is incorporated to access multiple ends without having to locate each of the services (In this case service A and B)

## Deployment

Each maven subproject is a Spring Boot application. Running the example would be as easy as running the following:
`mvn spring-boot:run`
inside each of the suprojects.

The recommended way to deploy is:

- Deploy config-service
- Deploy service a
- Deploy service b
- Deploy Eureka service
- Deploy Zuul proxy service<commit_msg>Updated README for zuul proxy example<commit_after># Zuul proxy microservice
Examples of microservice instrastructures: Zuul proxy

## Blog post
For this example, a Zuul proxy used as edge service will be incorporated.
Explanation of the architecture and purpose of having a Zuul proxy:
http://www.josedab.com/2016/03/01/microservices-using-zuul-proxy-as-a-micro-proxy-and-api-gateway/

## Overview
Zuul service proxying GET and POST requests. 
On top of proxying requests, distributed messaging is incorporated to access multiple ends without having to locate each of the services (In this case service A and B)

## Deployment

Each maven subproject is a Spring Boot application. Running the example would be as easy as running the following:
`mvn spring-boot:run`
inside each of the suprojects.

The recommended way to deploy is:

- Deploy config-service
    ```
    cd configuration-service
    mvn spring-boot:run
    ```
- Deploy service a
    ```
    cd svca-service
    mvn spring-boot:run
    ```
- Deploy service b
    ```
    cd svcb-service
    mvn spring-boot:run
    ```
- Deploy Eureka service
    ```
    cd eureka-service
    mvn spring-boot:run
    ```
- Deploy Zuul proxy service
    ```
    cd zuul-service
    mvn spring-boot:run
    ```

## Test
On the console, you could run `jps`. This would show the java processes. An output of the services runing could be:
```
1264 ConfigurationServiceApplication
1265 EurekaServiceApplication
1266 SvcAServiceApplication
1267 SvcBServiceApplication
1268 ZuulProxyClientApplication
```

### Urls
To hit the services deployed, you could try the following urls:
- Zuul service health status [http://localhost:9000/health]
- Microservice A
  - Through Zuul proxy [http://localhost:9000/svca-service]
  - Endpoint to service A: [http://localhost:9000/svca-service/socialProfiles]
  - Url of the service [http://localhost:5000]
  - Endpoint to service A: http://localhost:5000/socialProfiles
- Microservice B
  - Through Zuul proxy [http://localhost:9000/svcb-service]
  - Endpoint to service B [http://localhost:9000/svcb-service/socialProfiles]
  - Url of the service [http://localhost:7000]
  - Endpoint to service A [http://localhost:7000/socialProfiles]
- Composition of services
  - Endpoint for composition of service A and B: http://localhost:9000/profiles/names
- Eureka service registry [http://localhost:8761]
{'fraction_non_alphanumeric': 0.0794661813770094, 'fraction_numerical': 0.024264482863208977, 'mean_word_length': 4.042813455657492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3843459', 'n_tokens_mistral': 1015, 'n_tokens_neox': 954, 'n_words': 373}