{"id":18535748,"url":"https://github.com/iamfrench/efrei-m2-st2dccc","last_synced_at":"2026-05-17T02:34:08.296Z","repository":{"id":74739854,"uuid":"323942348","full_name":"IAmFrench/EFREI-M2-ST2DCCC","owner":"IAmFrench","description":"Cloud Integration (M2, M2-APP-LSI, M2-APP-RI, M2-PRO - 2021S9)","archived":false,"fork":false,"pushed_at":"2021-01-27T00:33:53.000Z","size":3025,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T00:39:15.926Z","etag":null,"topics":["docker-compose","github-package-registry","microservice","openapi3","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IAmFrench.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-23T15:50:46.000Z","updated_at":"2021-01-27T00:33:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"75b0afa9-8fb4-4655-949b-be623a44ee0d","html_url":"https://github.com/IAmFrench/EFREI-M2-ST2DCCC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IAmFrench/EFREI-M2-ST2DCCC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2FEFREI-M2-ST2DCCC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2FEFREI-M2-ST2DCCC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2FEFREI-M2-ST2DCCC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2FEFREI-M2-ST2DCCC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IAmFrench","download_url":"https://codeload.github.com/IAmFrench/EFREI-M2-ST2DCCC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2FEFREI-M2-ST2DCCC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280893646,"owners_count":26409279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","github-package-registry","microservice","openapi3","swagger","swagger-ui"],"created_at":"2024-11-06T19:27:11.000Z","updated_at":"2025-10-25T01:39:52.794Z","avatar_url":"https://github.com/IAmFrench.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ST2DCCC\nCloud Integration (M2, M2-APP-LSI, M2-APP-RI, M2-PRO - 2021S9)\n\n## Overview\nThis repository contains the final project (that includes labs 1 to 3).\n\nInstructions are available in `.pdf` files at the root of the directory.\n\n![Application Diagram](./artefacts/app-diagram.png)\n\n## Prerequisite\nThis project runs on docker.\n\nYou can check if docker is properly installed and running by typing into a terminal a simple docker command such as `docker ps`:\n\n![Test if docker is running using docker ps command](./artefacts/terminal-test-if-docker-is-running-docker-ps.gif)\n\n## Installation\nClone this repository (you can use Git, or use the GUI client GitHub Desktop)\n\nAnd that's it !\n\n## Run\nNow you can run the project. To do so, you will have to open a terminal and execute the following command :\n\n*Optionnal* You can download pre-built images from the GitHub Container Registry using the following command:\n\n```bash\ndocker pull ghcr.io/iamfrench/efrei-m2-st2dccc_movie\ndocker pull ghcr.io/iamfrench/efrei-m2-st2dccc_actor\n```\n\nThen you can start the application using the following command:\n\n```bash\ndocker-compose up -d\n```\n\n\u003e Hint: To speed up the build process, you can use the following command:\n\n```bash\ndocker-compose build --parallel\n```\n\nThis command will read the [`docker-compose.yml`](./docker-compose.yml) file and deploy the application on your local computer.\n\n![Deploy the application is running using docker-compose up commands](./artefacts/terminal-deploy-the-application-docker-compose-up.gif)\n\nYou can check if the containers are running using this command:\n\n```bash\ndocker-compose ps\n```\n\n![Check if the application is running using docker-compose ps commands](./artefacts/terminal-check-if-the-application-is-running-using-docker-compose-ps.png)\n\n## Tests\nNow that you have installed, and run the application, it's time to play with the project!\n\nOpen you web browser to [`http://localhost`](http://localhost)\n\nThe interface that is displayed is the default Swagger UI web Client. This web client has been fed with a definition file ([`swagger.yaml`](./swagger.yaml)) that describe our APIs.\n\n![Open the Swagger UI web client using a basic web browser](./artefacts/chrome-open-swagger-web-client.png)\n\n### Available endpoints and methods\nBecause we have two services running we have chosen to expose them to two different ports as displayed in the solution diagram.\nThe port `81` is used by the actor service and the port `82` is used by the movie service.\n\nIn order to use those endpoints on different ports in Swagger UI we have overwritten the default host (lines `4` and `9`) in the [`docker-compose.yml`](./docker-compose.yml) file:\n\n![Override the default server](./artefacts/swagger-yaml-custom-servers.png)\n\n#### Actor Service (on port 81)\n\n##### `GET` finAll\n\u003e Return all movies stored in the movie service with actors\n\n##### `GET` findOne/`{movieId}`\n\u003e Return a movie from the movie service, with actors by `movieId`\n\n\n#### Movie Service (on port 82)\n\n##### `GET` movies\n\u003e Return all movies\n\n##### `POST` movies\n\u003e Add a new movie to the movie service\n\n##### `GET` movies/`{movieId}`\n\u003e Return a single movie by `movieId` \n\n##### `PUT` movies/`{movieId}`\n\u003e Edit a movie by `movieId` \n\n##### `DELETE` movies/`{movieId}`\n\u003e Delete a movie by `movieId` \n\n### Test the circuit breaker\nThe circuit breaker is implemented in the actor service. It is used when this service call the movie service.\n\n#### Service is unavailable (no response)\nIf the requested service is unavailable a fallback method is implemented to prevent a cascade failure.\n\nTo create a failure, you just need to kill the container running the movie service. To do so, we will use the Docker Desktop Dashboard, a GUI for Docker:\n\n![Stop the container responsible for running the movie service](./artefacts/docker-desktop-dashboard-stop-movie-container.png)\n\nNow that the container is down, we can test if the circuit breaker is working by executing a REST request to the actor service.\n\nTo do so, we will use the Swagger UI:\n\n![Making a REST request when the movie service is down](./artefacts/chrome-swagger-ui-movie-service-down-request.png)\n\nAnd here is the response:\n\n![REST response from the actor service when the movie service is down](./artefacts/chrome-swagger-ui-movie-service-down-response.png)\n\nAs expected, the movie service is unavailable, therefore the fallback method have been called and the response modified accordingly.\n\nHere is the code responsible for that (in the actor service):\n\n![REST Client of the actor service embedded into a circuit breaker](./artefacts/actor-service-rest-client-with-fallback.png)\n\n\n#### Service is slow or degraded (timelimit) \nIf a request is taking too much time, a fallback method is taking care of providing a response to ensure a continuity of service.\n\nTo simulate this delay, we have implemented an argument (passed as a query parameter) for the `GET {movie-service}/movies/{id}` route in the movie service:\n\n![Delay added to the query in the Movie Service using a pause statement](./artefacts/movie-service-delay.png)\n\nAnd thanks to the Swagger UI we can test this:\n\n![Swagger UI query that induce a delay of 600ms](./artefacts/chrome-swagger-ui-delay-query.png)\n\nThis produces the following response:\n\n![Swagger UI response after a query inducing a delay of 600ms](./artefacts/chrome-swagger-ui-delay-response.png)\n\nAs expected, a fallback method has been triggered.\n\nHere is the code responsible for that (in the actor service):\n\n![REST Client of the actor service embedded into a circuit breaker](./artefacts/actor-service-rest-client-with-fallback.png)\n\nThe time limit has been set in the circuit breaker config:\n\n![Circuit breaker config file](./artefacts/actor-service-circuit-breaker-config.png)\n\n## Clean up\nNow that you have finished playing with the application. It's time to clean the project.\n\nTo do so, open a terminal and type the following command:\n\n```bash\ndocker-compose down -v\n```\n\nThis command will stop and remove containers and networks from your computer assigned to our project.\n\n![Cleaning the application using the docker-compose down command](./artefacts/terminal-retire-application-using-docker-compose-down.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfrench%2Fefrei-m2-st2dccc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamfrench%2Fefrei-m2-st2dccc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfrench%2Fefrei-m2-st2dccc/lists"}