{"id":22433182,"url":"https://github.com/andresweitzel/microservicios_spring_cloud_netflix_spring_boot","last_synced_at":"2026-02-22T14:37:29.247Z","repository":{"id":43686079,"uuid":"454963161","full_name":"andresWeitzel/Microservicios_Spring_Cloud_Netflix_Spring_Boot","owner":"andresWeitzel","description":"Microservicios  con  Spring Boot, Spring MVC, Spring Data JPA,  Spring Cloud Eureka, Grafana, Prometheus, ApiGateway, Resilience4J, Lombok, Maven, Postman, Git, Postgres, Mysql y Otras Tecnologías","archived":false,"fork":false,"pushed_at":"2024-01-12T22:43:53.000Z","size":7074,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-01-13T12:55:03.795Z","etag":null,"topics":["api-gateway","api-rest","circuit-breaker","eureka-server","grafana","hibernate","java","lombok","maven","mysql","postgresql","prometheus","resilience4j","spring","spring-boot","spring-cloud","spring-data-jpa"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andresWeitzel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-02-02T22:58:44.000Z","updated_at":"2023-09-19T14:22:09.000Z","dependencies_parsed_at":"2024-01-04T00:55:59.540Z","dependency_job_id":"80cb32d8-40ab-461d-9e2d-d2a73e799987","html_url":"https://github.com/andresWeitzel/Microservicios_Spring_Cloud_Netflix_Spring_Boot","commit_stats":null,"previous_names":[],"tags_count":5,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FMicroservicios_Spring_Cloud_Netflix_Spring_Boot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FMicroservicios_Spring_Cloud_Netflix_Spring_Boot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FMicroservicios_Spring_Cloud_Netflix_Spring_Boot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FMicroservicios_Spring_Cloud_Netflix_Spring_Boot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andresWeitzel","download_url":"https://codeload.github.com/andresWeitzel/Microservicios_Spring_Cloud_Netflix_Spring_Boot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228377561,"owners_count":17910449,"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","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":["api-gateway","api-rest","circuit-breaker","eureka-server","grafana","hibernate","java","lombok","maven","mysql","postgresql","prometheus","resilience4j","spring","spring-boot","spring-cloud","spring-data-jpa"],"created_at":"2024-12-05T22:14:12.475Z","updated_at":"2026-02-22T14:37:29.230Z","avatar_url":"https://github.com/andresWeitzel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./assets/img/MicroservicesArquitectura.png\" \u003e\n\u003c/div\u003e\n\n  \u003cdiv align=\"right\"\u003e\n    \u003cimg width=\"24\" height=\"24\" src=\"./assets/icons/backend/java/png/java.png\" /\u003e\n    \u003cimg width=\"20\" height=\"20\" src=\"./assets/icons/devops/png/maven.png\" /\u003e\n    \u003cimg width=\"22\" height=\"22\" src=\"./assets/icons/devops/png/postman.png\" /\u003e\n    \u003cimg width=\"22\" height=\"22\" src=\"./assets/icons/devops/png/git.png\" /\u003e\n\t\u003cimg width=\"20\" height=\"20\" src=\"./assets/icons/devops/png/grafana.png\" /\u003e \n\t\u003cimg width=\"20\" height=\"20\" src=\"./assets/icons/devops/png/prometheus.png\" /\u003e  \n    \u003cimg width=\"20\" height=\"\" src=\"./assets/icons/backend/java/png/junit.png\" /\u003e\n    \u003cimg width=\"20\" height=\"20\" src=\"./assets/icons/backend/java/png/spring-boot.png\" /\u003e \n    \u003cimg width=\"20\" height=\"20\" src=\"./assets/icons/backend/java/png/spring-cloud.png\" /\u003e \n\t\u003cimg width=\"20\" height=\"19\" src=\"./assets/icons/backend/java/png/spring-security.png\" /\u003e \n\t\u003cimg width=\"20\" height=\"19\" src=\"./assets/icons/database/png/mysql.png\" /\u003e  \n\t\u003cimg width=\"20\" height=\"20\" src=\"./assets/icons/database/png/postgres.png\" /\u003e\n\t   \n  \u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n\n\n\u003cdiv align=\"right\"\u003e \n  \u003ca href=\"./assets/translation/README.es.md\"\u003e\n    \u003cimg src=\"./assets/icons/translation/arg-flag.jpg\" width=\"65\" height=\"40\" /\u003e\n  \u003c/a\u003e \n  \u003ca href=\"./README.md\"\u003e\n    \u003cimg src=\"./assets/icons/translation/eeuu-flag.jpg\" width=\"65\" height=\"40\" /\u003e\n  \u003c/a\u003e \n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# Real Estate Microservices ![(status-completed)](./assets/icons/badges/status-completed.svg)\n\n\u003c/div\u003e\n\nImplementation of Microservices for real estate with Spring Boot, Spring Cloud, Spring Data JPA, Resilience4J, Grafana, Prometheus, Lombok, Maven, Postman, RESTful API, Postgres, MySQL and other Technologies.\n\n\u003cbr\u003e\n\n* [Postgres real estate database repository](https://github.com/andresWeitzel/db_inmobiliaria_microservicios_postgres)\n* [MySQL property inspections database repository](https://github.com/andresWeitzel/db_inspecciones_inmuebles_microservicios_mysql)\n* [Functional Playlist](https://www.youtube.com/playlist?list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe) \u003ca href=\"https://www.youtube.com/playlist?list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\" target=\"_blank\"\u003e \u003cimg src=\"./assets/icons/social-networks/yt.png\" width=\"25\" /\u003e\u003c/a\u003e\n \n\n\n\u003cbr\u003e\n\n## Index 📜\n\n\u003cdetails\u003e\n \u003csummary\u003e View Details \u003c/summary\u003e\n \n\u003cdiv align=\"right\"\u003e\n\n`Latest update: 19/02/26` \n\n\u003c/div\u003e\n \n \n### Section 1) Description, Technologies and Dependencies \n \n - [1.0) Project Description.](#10-project-description-)\n - [1.1) Design Patterns.](#11-design-patterns-)\n - [1.2) Technologies.](#12-technologies-)\n     - [1.2.1) Downloads.](#121-downloads)\n - [1.3) Maven Dependencies.](#13-maven-dependencies-)\n \n### Section 2) Endpoints and Resources \n \n - [2.0) EndPoints.](#endpoints-)\n - [2.1) Resources by Endpoints.](#graphical-documentation-of-resources-by-endpoints-swagger-ui-)\n - [2.2) Request and Response Examples.](#22-request-and-response-examples-)\n \n \n### Section 3) Functionality Testing and References\n \n - [3.0) Functionality Testing.](#30-functionality-testing-)\n - [1.1) References.](#31-references-)\n\t\n### Section 4) Creation and Configuration of the InmuebleService Microservice Model from scratch\n \n - [4.0) InmuebleService Microservice Model.](#40-inmuebleservice-microservice-model-)\n     - [4.0.0) Creation and Configuration.](#400-creation-and-configuration)\n     - [4.0.1) Enums.](#401-enums)\n     - [4.0.2) Entities.](#402-entities)\n     - [4.0.3) Interfaces.](#403-interfaces)\n     - [4.0.4) Services.](#404-services)\n     - [4.0.5) Value Objects.](#405-value-objects)\n     - [4.0.6) Template Value Objects.](#406-template-value-objects)\n     - [4.0.7) Controllers.](#407-controllers)\n- [4.1) Database configuration.](#41-database-configuration-)\n- [4.2) application.properties configuration.](#42-application-properties-configuration)\n- [4.3) PostgreSQL management from cmd.](#43-postgresql-management-from-cmd)\n- [4.4) Functionality testing.](#44-functionality-testing)\n\n### Section 5) Git usage and management\n\n- [5.0) Download.](#50-download-)\n- [5.1) Upload project to remote repository.](#51-upload-project-to-remote-repository-)\n- [5.2) Project repository update.](#52-project-repository-update-)\n \n\t\n\t\n\u003c/details\u003e\n\n\n\u003cbr\u003e\n\n## Section 1) Description, Technologies and Dependencies \n\n\n### 1.0) Project Description [🔝](#index-) \n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n \n \u003cbr\u003e\n\n* This project was created to put into practice the interrelation and operation of several Microservices with different DBMS such as MySQL and PostgreSQL.\n* The `PropietarioInmuebleService` and `InmuebleService` Microservices implement the same PostgreSQL DBMS database for a real estate company.\n* The `InspeccionInmuebleService` Microservice will communicate with a MySQL database for the validation and control of the properties.\n* The Generic Management Service for Microservices will be `EurekaService`, this will not implement any database as it will be responsible for all the management and Control of the rest of the Microservices and Services.\n* The `API Gateway` Service will be in charge of managing the rest of the 3 microservices of the application, it is interconnected through the Circuit Breaker Design Pattern for Exception Control, Fault Tolerance, etc. All microservice resources go through the port and address of this service.\n* The `ResilienceFourJ` Service will be in charge of directly handling Exception Control, Errors, etc. that may occur, just like the API Gateway handles the Circuit Breaker pattern, in addition, for each resource of each microservice, the modules of said pattern are implemented.\n* ResilienceFourJ is directly configured to work with `Prometheus` and `Grafana`. Prometheus will handle all the ResilienceFourJ information and Grafana will deploy this information in a Dashboard-type Graphical environment.\n\n\n* The Project consists of 3 REST microservices and 3 management, administration and security services for the microservices\n\n``` Microservices\n|  |  |--------\u003e Rest Microservice InmuebleService ----------------\u003e db_inmobiliaria_microservicios  \t\t--\u003e (Postgres) --\u003e (shared) \n|  |-----------\u003e Rest Microservice PropietarioInmuebleService------\u003e db_inmobiliaria_microservicios  \t\t--\u003e (Postgres) --\u003e (shared) \n|--------------\u003e Rest Microservice InspeccionInmuebleService-------\u003e db_inspecciones_inmuebles_microservicios   --\u003e (Mysql)    --\u003e (unique)  \n```\n\n```\nServices\n|  |  |  |-----\u003e EurekaService -----------\u003e Microservices Management Server\n|  |  |--------\u003e ApiGatewayService -------\u003e Proxy with load balancing for microservice request management \n|  |-----------\u003e ResilienceFourJService --\u003e Service for Exception Control and Fault Tolerance. Circuit Breaker Pattern\n| |------------\u003e Prometheus/Actuator Service -----\u003e Handling of ResilienceFourJ data\n|--------------\u003e Grafana Dashboard Service -------\u003e Deployment of data transferred by Prometheus\n```\n \n \u003cbr\u003e\n\n* [Postgres real estate database repository](https://github.com/andresWeitzel/db_inmobiliaria_microservicios_postgres)\n* [MySQL property inspections database repository](https://github.com/andresWeitzel/db_inspecciones_inmuebles_microservicios_mysql)\n* [Project PlayList](https://www.youtube.com/playlist?list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe)\n \n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n### 1.1) Design Patterns [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n \n \u003cbr\u003e\n\n| **Design Pattern** | **Purpose** |               \n| ------------- | ------------- |\n| DAO | Use of interfaces and repositories for data persistence and storage. |\n| MVC | Separation and Representation of Data, Error handling, Scalability, etc  |\n| VO  | Value Object pattern for Object relationship through Templates of each Microservice |\n| DTO  | Pattern for the Use of POJO Objects for data transfer between Microservices and Resilience4J |\n| Circuit Breaker | Pattern for Exception Control and Handling along with Fault Tolerance |\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n### 1.2) Technologies [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n \n \u003cbr\u003e\n\n| **Technologies** | **Version** | **Purpose** |           \n| ------------- | ------------- | ------------- |\n| [Java](https://docs.oracle.com/en/) |  12.0.2 | JDK |\n| [Spring Tool Suite 4](https://spring.io/blog/2021/06/21/spring-tools-4-11-0-released) | 4.9.0  | IDE |\n| [Spring Boot](https://spring.io/) |  2.6.4  | Framework |\n| [Spring Boot Data JPA](https://spring.io/projects/spring-data-jpa)  | 2.6.3 | Object mapping and database persistence |\n| [Spring Validation](https://www.baeldung.com/spring-boot-bean-validation)  | 2.7 | Annotations for Validations |\n| [Eureka Server and Client](https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-eureka-server.html) | 3.1.1 | Microservices Administration |\n| [Api-Gateway](https://www.baeldung.com/spring-cloud-gateway) | 3.1.1 | Proxy Resource Management |\n| [Resilience4J](https://resilience4j.readme.io/docs) | 3.1.1 | Circuit Breaker Pattern Utilization |\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n### 1.2.1) Downloads [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n \n \u003cbr\u003e\n\n* [Java-JDK 12](https://www.oracle.com/java/technologies/javase/jdk12-archive-downloads.html)\n* [Spring Tool Suite 4](https://spring.io/tools)\n* [Prometheus](https://prometheus.io/download/)\n* [Grafana](https://grafana.com/grafana/download?platform=windows)\n* [Dbeaver](https://dbeaver.io/download/)\n* [PostgreSQL](https://www.postgresql.org/download/)\n* [MySQL](https://www.mysql.com/it/)\t\n* [Xampp](https://www.apachefriends.org/download.html)\n* [Lombok](https://projectlombok.org/download)\n* [Open UI](https://open-ui.org/)\n* [Postman](https://www.postman.com/downloads/)\n* [MongoDB](https://www.mongodb.com/try/download/community)\n* [MongoDB Compass](https://www.mongodb.com/try/download/compass)\n* [Git](https://git-scm.com/downloads)\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n### 1.3) Maven Dependencies [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n \n \u003cbr\u003e\n\n| **Maven Dependency**  | **Version** | **Purpose** |             \n| ------------- | ------------- | ------------- |\n| mysql-connector | 8.0.21 |  Connection to MySQL DB |\n| postgresql-connector | 42.3.1 | Connection to PostgreSQL DB  | \n| lombok | 1.18.22 |  Dependency for code automation |\n| spring-boot-starter-test | 2.6.4 | Testing usage |\n| spring-boot-starter-data-jpa | 2.6.4 | JpaRepository API for method handling | \n| spring-boot-starter-devtools | 2.6.6 | Tool for runtime recompilation |\n| spring-boot-starter-web | 2.6.4 | Automatic web configuration for Maven to Spring |\n| spring-boot-starter-actuator | 2.6.6 | Api Rest monitoring and management |\n| spring-boot-starter-aop | 2.6.6 | Api Rest modularity |\n| spring-cloud-starter-netflix-eureka-client | 3.1.1 | Connection to Eureka Service |\n| spring-cloud-starter-netflix-eureka-server | 3.1.1 | Dependencies for Eureka Service |\n| spring-cloud-starter-gateway | 3.1.1 | Proxy Resource Management |\n| spring-cloud-starter-bootstrap | 3.1.1 | Server Configuration Preparation |\n| spring-cloud-starter-config | 3.1.1 | Allows externalizing and centralizing microservice configuration in one place |\n| spring-cloud-starter-circuitbreaker-resilience4j | 2.1.1 | Dependency for Circ Break and Resiliency usage | \n\n| **Maven Dependency Manager**  | **Version** | **Purpose** |             \n| ------------- | ------------- | ------------- |\n| spring-cloud-dependencies | 2021.0.0 | Cloud Dependencies Manager |\n\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\u003cbr\u003e\n\n## Section 2) EndPoints and Resources\n\n### 2.0) EndPoints [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n \n### Default MicroServices EndPoints:\n* http://localhost:8092/v1/inmuebles/\n* http://localhost:8093/v1/propietarios-inmuebles/\n* http://localhost:8095/v1/inspecciones-inmuebles/\n\n### MicroServices EndPoints with Api Gateway:\n* http://localhost:9191/v1/inmuebles/\n* http://localhost:9191/v1/propietarios-inmuebles/\n* http://localhost:9191/v1/inspecciones-inmuebles/\n\n### MicroServices EndPoints with Resilience4J\n* http://localhost:9295/v1/inmueble-service\n* http://localhost:9295/v1/propietario-inmueble-service/\n* http://localhost:9295/v1/inspeccion-inmueble-service/\n\n### Analytical Endpoint with Prometheus\n* http://localhost:9295/actuator/prometheus\n\n### Deploy Endpoint with Grafana (username:admin password:admin)\n* http://localhost:3000/d/X034JGT7Gz/springboot-apm-dashboard?orgId=1\u0026from=now-1m\u0026to=now\n  \n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n\n### 2.1) Resources by Endpoints. (Swagger UI) [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\n### Services in Spring Cloud Eureka Server\n![Index app](./assets/img/eurekaServer.png)\n\n### MicroServices by host and port independently\n![Index app](./assets/img/microservicesList.png)\n\n### Initial Load of Resources via Grafana\n![Index app](./assets/img/carga_inicial.png)\n\n### GET Test Microservices port Resilience with Postman\n![Index app](./assets/img/getMicroservices.png)\n\n### Http Methods GET Statistics in Grafana\n![Index app](./assets/img/getHttpStadistic.png)\n\n### POST Test Microservices port Resilience with Postman\n![Index app](./assets/img/postMicroservices.png)\n\n### Http Methods POST Statistics in Grafana\n![Index app](./assets/img/postHttpStadistic.png)\n\n### Load after consuming Resources via Grafana\n![Index app](./assets/img/carga_uso.png)\n\t\n### CPU Usage of the System after consuming Resources via Grafana\n![Index app](./assets/img/systemCpuUsage.png)\n\n \n \u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.2) Request and Response Examples [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\n## Microservice InmuebleService\n\n### 2.2.1) POST Operations\n\n#### Create Inmueble\n\n###### Request (POST)\n\n**Method:** POST  \n**URL:** `http://localhost:8092/v1/inmuebles/`  \n**Headers:**  \n- Content-Type: application/json\n\n**Body (raw JSON):**\n```json\n{\n    \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"descr\": \"Departamento de 2 ambientes con balcón\",\n    \"tipo\": \"Departamento\",\n    \"estadoInm\": \"DISPONIBLE\",\n    \"precInmUsd\": 150000.0,\n    \"direc\": \"Av. Corrientes 1234\",\n    \"ubic\": \"Palermo\",\n    \"sitWeb\": \"www.inmobiliaria.com\"\n}\n```\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"descr\": \"Departamento de 2 ambientes con balcón\",\n    \"tipo\": \"Departamento\",\n    \"estadoInm\": \"DISPONIBLE\",\n    \"precInmUsd\": 150000.0,\n    \"direc\": \"Av. Corrientes 1234\",\n    \"ubic\": \"Palermo\",\n    \"sitWeb\": \"www.inmobiliaria.com\"\n}\n```\n\n###### Response (422 Unprocessable Entity)\n\n```json\n{\n    \"message\": \"No se ha Insertado el Inmueble en la Base de Datos\"\n}\n```\n\n### 2.2.2) GET Operations\n\n#### Get All Inmuebles (Paginated)\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8092/v1/inmuebles/listado?page=0\u0026size=5\u0026sort=id,desc`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"content\": [\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n            \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n            \"descr\": \"Departamento de 2 ambientes con balcón\",\n            \"tipo\": \"Departamento\",\n            \"estadoInm\": \"DISPONIBLE\",\n            \"precInmUsd\": 150000.0,\n            \"direc\": \"Av. Corrientes 1234\",\n            \"ubic\": \"Palermo\",\n            \"sitWeb\": \"www.inmobiliaria.com\"\n        }\n    ],\n    \"pageable\": {\n        \"sort\": {\n            \"sorted\": true,\n            \"unsorted\": false\n        },\n        \"pageNumber\": 0,\n        \"pageSize\": 5,\n        \"offset\": 0,\n        \"paged\": true,\n        \"unpaged\": false\n    },\n    \"totalElements\": 1,\n    \"totalPages\": 1,\n    \"last\": true,\n    \"first\": true,\n    \"sort\": {\n        \"sorted\": true,\n        \"unsorted\": false\n    },\n    \"numberOfElements\": 1,\n    \"size\": 5,\n    \"number\": 0\n}\n```\n\n#### Get Inmueble by ID\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8092/v1/inmuebles/id/550e8400-e29b-41d4-a716-446655440001`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"descr\": \"Departamento de 2 ambientes con balcón\",\n    \"tipo\": \"Departamento\",\n    \"estadoInm\": \"DISPONIBLE\",\n    \"precInmUsd\": 150000.0,\n    \"direc\": \"Av. Corrientes 1234\",\n    \"ubic\": \"Palermo\",\n    \"sitWeb\": \"www.inmobiliaria.com\"\n}\n```\n\n#### Get Inmuebles by Propietario ID\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8092/v1/inmuebles/id-propietario-inmueble/550e8400-e29b-41d4-a716-446655440000?page=0\u0026size=10`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"content\": [\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n            \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n            \"descr\": \"Departamento de 2 ambientes con balcón\",\n            \"tipo\": \"Departamento\",\n            \"estadoInm\": \"DISPONIBLE\",\n            \"precInmUsd\": 150000.0,\n            \"direc\": \"Av. Corrientes 1234\",\n            \"ubic\": \"Palermo\",\n            \"sitWeb\": \"www.inmobiliaria.com\"\n        }\n    ],\n    \"totalElements\": 1,\n    \"totalPages\": 1\n}\n```\n\n#### Get Inmueble with Propietario Template\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8092/v1/inmuebles/inmueble-con-propietario-inmueble/id-inm/550e8400-e29b-41d4-a716-446655440001`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"propietarioInmuebleVO\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"nombre\": \"Juan\",\n        \"apellido\": \"Pérez\",\n        \"edad\": 35,\n        \"fechaNac\": \"1988-05-15\",\n        \"tipoDoc\": \"DNI\",\n        \"nroDoc\": \"12345678\",\n        \"direc\": \"Av. Libertador 1000\",\n        \"nroTelPrinc\": \"11-1234-5678\",\n        \"nroTelSec\": \"11-8765-4321\",\n        \"email\": \"juan.perez@email.com\"\n    },\n    \"inmueble\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n        \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"descr\": \"Departamento de 2 ambientes con balcón\",\n        \"tipo\": \"Departamento\",\n        \"estadoInm\": \"DISPONIBLE\",\n        \"precInmUsd\": 150000.0,\n        \"direc\": \"Av. Corrientes 1234\",\n        \"ubic\": \"Palermo\",\n        \"sitWeb\": \"www.inmobiliaria.com\"\n    }\n}\n```\n\n### 2.2.3) PUT Operations\n\n#### Update Inmueble\n\n###### Request (PUT)\n\n**Method:** PUT  \n**URL:** `http://localhost:8092/v1/inmuebles/`  \n**Headers:**  \n- Content-Type: application/json\n\n**Body (raw JSON):**\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"descr\": \"Departamento de 2 ambientes con balcón y terraza\",\n    \"tipo\": \"Departamento\",\n    \"estadoInm\": \"VENDIDO\",\n    \"precInmUsd\": 160000.0,\n    \"direc\": \"Av. Corrientes 1234\",\n    \"ubic\": \"Palermo\",\n    \"sitWeb\": \"www.inmobiliaria.com\"\n}\n```\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"descr\": \"Departamento de 2 ambientes con balcón y terraza\",\n    \"tipo\": \"Departamento\",\n    \"estadoInm\": \"VENDIDO\",\n    \"precInmUsd\": 160000.0,\n    \"direc\": \"Av. Corrientes 1234\",\n    \"ubic\": \"Palermo\",\n    \"sitWeb\": \"www.inmobiliaria.com\"\n}\n```\n\n### 2.2.4) DELETE Operations\n\n#### Delete Inmueble\n\n###### Request (DELETE)\n\n**Method:** DELETE  \n**URL:** `http://localhost:8092/v1/inmuebles/550e8400-e29b-41d4-a716-446655440001`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"message\": \"Se ha Eliminado el Inmueble de la Base de Datos\"\n}\n```\n\n---\n\n## Microservice PropietarioInmuebleService\n\n### 2.2.5) POST Operations\n\n#### Create Propietario Inmueble\n\n###### Request (POST)\n\n**Method:** POST  \n**URL:** `http://localhost:8093/v1/propietarios-inmuebles/`  \n**Headers:**  \n- Content-Type: application/json\n\n**Body (raw JSON):**\n```json\n{\n    \"nombre\": \"María\",\n    \"apellido\": \"González\",\n    \"edad\": 42,\n    \"fechaNac\": \"1981-03-20\",\n    \"tipoDoc\": \"DNI\",\n    \"nroDoc\": \"87654321\",\n    \"direc\": \"Av. Santa Fe 2000\",\n    \"nroTelPrinc\": \"11-9876-5432\",\n    \"nroTelSec\": \"11-1111-2222\",\n    \"email\": \"maria.gonzalez@email.com\"\n}\n```\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440002\",\n    \"nombre\": \"María\",\n    \"apellido\": \"González\",\n    \"edad\": 42,\n    \"fechaNac\": \"1981-03-20\",\n    \"tipoDoc\": \"DNI\",\n    \"nroDoc\": \"87654321\",\n    \"direc\": \"Av. Santa Fe 2000\",\n    \"nroTelPrinc\": \"11-9876-5432\",\n    \"nroTelSec\": \"11-1111-2222\",\n    \"email\": \"maria.gonzalez@email.com\"\n}\n```\n\n### 2.2.6) GET Operations\n\n#### Get All Propietarios (Paginated)\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8093/v1/propietarios-inmuebles/listado?page=0\u0026size=5\u0026sort=apellido,asc`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"content\": [\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n            \"nombre\": \"Juan\",\n            \"apellido\": \"Pérez\",\n            \"edad\": 35,\n            \"fechaNac\": \"1988-05-15\",\n            \"tipoDoc\": \"DNI\",\n            \"nroDoc\": \"12345678\",\n            \"direc\": \"Av. Libertador 1000\",\n            \"nroTelPrinc\": \"11-1234-5678\",\n            \"nroTelSec\": \"11-8765-4321\",\n            \"email\": \"juan.perez@email.com\"\n        },\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440002\",\n            \"nombre\": \"María\",\n            \"apellido\": \"González\",\n            \"edad\": 42,\n            \"fechaNac\": \"1981-03-20\",\n            \"tipoDoc\": \"DNI\",\n            \"nroDoc\": \"87654321\",\n            \"direc\": \"Av. Santa Fe 2000\",\n            \"nroTelPrinc\": \"11-9876-5432\",\n            \"nroTelSec\": \"11-1111-2222\",\n            \"email\": \"maria.gonzalez@email.com\"\n        }\n    ],\n    \"totalElements\": 2,\n    \"totalPages\": 1\n}\n```\n\n#### Get Propietario by ID\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8093/v1/propietarios-inmuebles/id/550e8400-e29b-41d4-a716-446655440000`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"nombre\": \"Juan\",\n    \"apellido\": \"Pérez\",\n    \"edad\": 35,\n    \"fechaNac\": \"1988-05-15\",\n    \"tipoDoc\": \"DNI\",\n    \"nroDoc\": \"12345678\",\n    \"direc\": \"Av. Libertador 1000\",\n    \"nroTelPrinc\": \"11-1234-5678\",\n    \"nroTelSec\": \"11-8765-4321\",\n    \"email\": \"juan.perez@email.com\"\n}\n```\n\n#### Get Propietarios by Nombre\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8093/v1/propietarios-inmuebles/nombre/Juan?page=0\u0026size=10`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"content\": [\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n            \"nombre\": \"Juan\",\n            \"apellido\": \"Pérez\",\n            \"edad\": 35,\n            \"fechaNac\": \"1988-05-15\",\n            \"tipoDoc\": \"DNI\",\n            \"nroDoc\": \"12345678\",\n            \"direc\": \"Av. Libertador 1000\",\n            \"nroTelPrinc\": \"11-1234-5678\",\n            \"nroTelSec\": \"11-8765-4321\",\n            \"email\": \"juan.perez@email.com\"\n        }\n    ],\n    \"totalElements\": 1,\n    \"totalPages\": 1\n}\n```\n\n### 2.2.7) PUT Operations\n\n#### Update Propietario Inmueble\n\n###### Request (PUT)\n\n**Method:** PUT  \n**URL:** `http://localhost:8093/v1/propietarios-inmuebles/`  \n**Headers:**  \n- Content-Type: application/json\n\n**Body (raw JSON):**\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"nombre\": \"Juan Carlos\",\n    \"apellido\": \"Pérez\",\n    \"edad\": 36,\n    \"fechaNac\": \"1988-05-15\",\n    \"tipoDoc\": \"DNI\",\n    \"nroDoc\": \"12345678\",\n    \"direc\": \"Av. Libertador 1500\",\n    \"nroTelPrinc\": \"11-1234-5678\",\n    \"nroTelSec\": \"11-8765-4321\",\n    \"email\": \"juan.perez@email.com\"\n}\n```\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"nombre\": \"Juan Carlos\",\n    \"apellido\": \"Pérez\",\n    \"edad\": 36,\n    \"fechaNac\": \"1988-05-15\",\n    \"tipoDoc\": \"DNI\",\n    \"nroDoc\": \"12345678\",\n    \"direc\": \"Av. Libertador 1500\",\n    \"nroTelPrinc\": \"11-1234-5678\",\n    \"nroTelSec\": \"11-8765-4321\",\n    \"email\": \"juan.perez@email.com\"\n}\n```\n\n### 2.2.8) DELETE Operations\n\n#### Delete Propietario Inmueble\n\n###### Request (DELETE)\n\n**Method:** DELETE  \n**URL:** `http://localhost:8093/v1/propietarios-inmuebles/550e8400-e29b-41d4-a716-446655440000`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"message\": \"Se ha Eliminado el Propietario del Inmueble de la Base de Datos\"\n}\n```\n\n---\n\n## Microservice InspeccionInmuebleService\n\n### 2.2.9) POST Operations\n\n#### Create Inspeccion Inmueble\n\n###### Request (POST)\n\n**Method:** POST  \n**URL:** `http://localhost:8095/v1/inspecciones-inmuebles/`  \n**Headers:**  \n- Content-Type: application/json\n\n**Body (raw JSON):**\n```json\n{\n    \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"estadoInsp\": \"PENDIENTE\",\n    \"tipoInsp\": \"ESTRUCTURAL\",\n    \"descrInsp\": \"Inspección estructural completa del edificio\",\n    \"empresa\": \"Inspecciones S.A.\",\n    \"direc\": \"Av. Corrientes 1234\",\n    \"nroTel\": \"11-5555-6666\",\n    \"costo\": 500.0,\n    \"fecha\": \"2024-01-15\",\n    \"hora\": \"14:30:00\"\n}\n```\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440003\",\n    \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"estadoInsp\": \"PENDIENTE\",\n    \"tipoInsp\": \"ESTRUCTURAL\",\n    \"descrInsp\": \"Inspección estructural completa del edificio\",\n    \"empresa\": \"Inspecciones S.A.\",\n    \"direc\": \"Av. Corrientes 1234\",\n    \"nroTel\": \"11-5555-6666\",\n    \"costo\": 500.0,\n    \"fecha\": \"2024-01-15\",\n    \"hora\": \"14:30:00\"\n}\n```\n\n### 2.2.10) GET Operations\n\n#### Get All Inspecciones (Paginated)\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8095/v1/inspecciones-inmuebles/listado?page=0\u0026size=5\u0026sort=fecha,desc`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"content\": [\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440003\",\n            \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n            \"estadoInsp\": \"PENDIENTE\",\n            \"tipoInsp\": \"ESTRUCTURAL\",\n            \"descrInsp\": \"Inspección estructural completa del edificio\",\n            \"empresa\": \"Inspecciones S.A.\",\n            \"direc\": \"Av. Corrientes 1234\",\n            \"nroTel\": \"11-5555-6666\",\n            \"costo\": 500.0,\n            \"fecha\": \"2024-01-15\",\n            \"hora\": \"14:30:00\"\n        }\n    ],\n    \"totalElements\": 1,\n    \"totalPages\": 1\n}\n```\n\n#### Get Inspeccion by ID\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8095/v1/inspecciones-inmuebles/id/550e8400-e29b-41d4-a716-446655440003`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440003\",\n    \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"estadoInsp\": \"PENDIENTE\",\n    \"tipoInsp\": \"ESTRUCTURAL\",\n    \"descrInsp\": \"Inspección estructural completa del edificio\",\n    \"empresa\": \"Inspecciones S.A.\",\n    \"direc\": \"Av. Corrientes 1234\",\n    \"nroTel\": \"11-5555-6666\",\n    \"costo\": 500.0,\n    \"fecha\": \"2024-01-15\",\n    \"hora\": \"14:30:00\"\n}\n```\n\n#### Get Inspeccion with Inmueble Template\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:8095/v1/inspecciones-inmuebles/inspeccion-inmueble-con-inmueble/id-inmueble/550e8400-e29b-41d4-a716-446655440001`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"inspeccionInmuebleEntity\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440003\",\n        \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n        \"estadoInsp\": \"PENDIENTE\",\n        \"tipoInsp\": \"ESTRUCTURAL\",\n        \"descrInsp\": \"Inspección estructural completa del edificio\",\n        \"empresa\": \"Inspecciones S.A.\",\n        \"direc\": \"Av. Corrientes 1234\",\n        \"nroTel\": \"11-5555-6666\",\n        \"costo\": 500.0,\n        \"fecha\": \"2024-01-15\",\n        \"hora\": \"14:30:00\"\n    },\n    \"inmuebleVO\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440001\",\n        \"idPropInm\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"descr\": \"Departamento de 2 ambientes con balcón\",\n        \"tipo\": \"Departamento\",\n        \"estadoInm\": \"DISPONIBLE\",\n        \"precioInmUsd\": 150000.0,\n        \"direc\": \"Av. Corrientes 1234\",\n        \"ubic\": \"Palermo\",\n        \"sitWeb\": \"www.inmobiliaria.com\"\n    }\n}\n```\n\n### 2.2.11) PUT Operations\n\n#### Update Inspeccion Inmueble\n\n###### Request (PUT)\n\n**Method:** PUT  \n**URL:** `http://localhost:8095/v1/inspecciones-inmuebles/`  \n**Headers:**  \n- Content-Type: application/json\n\n**Body (raw JSON):**\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440003\",\n    \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"estadoInsp\": \"COMPLETADA\",\n    \"tipoInsp\": \"ESTRUCTURAL\",\n    \"descrInsp\": \"Inspección estructural completa del edificio - APROBADA\",\n    \"empresa\": \"Inspecciones S.A.\",\n    \"direc\": \"Av. Corrientes 1234\",\n    \"nroTel\": \"11-5555-6666\",\n    \"costo\": 500.0,\n    \"fecha\": \"2024-01-15\",\n    \"hora\": \"14:30:00\"\n}\n```\n\n###### Response (200 OK)\n\n```json\n{\n    \"id\": \"550e8400-e29b-41d4-a716-446655440003\",\n    \"idInm\": \"550e8400-e29b-41d4-a716-446655440001\",\n    \"estadoInsp\": \"COMPLETADA\",\n    \"tipoInsp\": \"ESTRUCTURAL\",\n    \"descrInsp\": \"Inspección estructural completa del edificio - APROBADA\",\n    \"empresa\": \"Inspecciones S.A.\",\n    \"direc\": \"Av. Corrientes 1234\",\n    \"nroTel\": \"11-5555-6666\",\n    \"costo\": 500.0,\n    \"fecha\": \"2024-01-15\",\n    \"hora\": \"14:30:00\"\n}\n```\n\n### 2.2.12) DELETE Operations\n\n#### Delete Inspeccion Inmueble\n\n###### Request (DELETE)\n\n**Method:** DELETE  \n**URL:** `http://localhost:8095/v1/inspecciones-inmuebles/550e8400-e29b-41d4-a716-446655440003`  \n**Headers:**  \n- Content-Type: application/json\n\n###### Response (200 OK)\n\n```json\n{\n    \"message\": \"Se ha Eliminado la Inspección del Inmueble de la Base de datos\"\n}\n```\n\n---\n\n## Microservices with API Gateway\n\n### 2.2.13) API Gateway Endpoints\n\n#### Get All Inmuebles through Gateway\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:9191/v1/inmuebles/listado?page=0\u0026size=5`  \n**Headers:**  \n- Content-Type: application/json\n\n#### Get All Propietarios through Gateway\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:9191/v1/propietarios-inmuebles/listado?page=0\u0026size=5`  \n**Headers:**  \n- Content-Type: application/json\n\n#### Get All Inspecciones through Gateway\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:9191/v1/inspecciones-inmuebles/listado?page=0\u0026size=5`  \n**Headers:**  \n- Content-Type: application/json\n\n---\n\n## Microservices with Resilience4J\n\n### 2.2.14) Resilience4J Endpoints\n\n#### Get All Inmuebles through Resilience4J\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:9295/v1/inmueble-service/listado`  \n**Headers:**  \n- Content-Type: application/json\n\n#### Get All Propietarios through Resilience4J\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:9295/v1/propietario-inmueble-service/listado`  \n**Headers:**  \n- Content-Type: application/json\n\n#### Get All Inspecciones through Resilience4J\n\n###### Request (GET)\n\n**Method:** GET  \n**URL:** `http://localhost:9295/v1/inspeccion-inmueble-service/listado`  \n**Headers:**  \n- Content-Type: application/json\n\n---\n\n## Error Responses\n\n### 2.2.15) Common Error Responses\n\n#### 422 Unprocessable Entity\n\n```json\n{\n    \"message\": \"No se ha Insertado el Inmueble en la Base de Datos\"\n}\n```\n\n#### 404 Not Found\n\n```json\n{\n    \"message\": \"Resource not found\"\n}\n```\n\n#### 500 Internal Server Error\n\n```json\n{\n    \"message\": \"Internal server error occurred\"\n}\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n## Section 3) Functionality Testing and References\n\n\n### 3.0) Functionality Testing [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\n\n### REST APIs Default Microservices\n\n* [Inmueble Service Microservice](https://www.youtube.com/watch?v=dpEpQqyBTEw\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=1)\n\n* [Propietario Inmueble Service Microservice](https://www.youtube.com/watch?v=ahi5WDX19rQ\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=2)\n\n* [Inspeccion Inmueble Service Microservice](https://www.youtube.com/watch?v=6KeUPebnKu8\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=3\u0026t=2s)\n\n\u003c/br\u003e\n\n###  REST APIs Microservices with API Gateway\n\n* [Microservices](https://www.youtube.com/watch?v=kkjxv7HMlNI\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=4)\n\n\u003c/br\u003e\n\n### REST APIs Microservices with Resilience4J\n\n* [Inmueble-Service Resilience Microservice](https://www.youtube.com/watch?v=9OEwhURfrXw\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=6\u0026t=214s)\n\n* [Propietario-Inmueble-Service and Inspección-Inmueble-Service Resilience Microservices](https://www.youtube.com/watch?v=mn-jAeEwt-8\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=6)\n\n\u003c/br\u003e\n\n### Microservices Data Analytics Deployment with Grafana and Prometheus \n\n* [HTTP Requests Analysis](https://www.youtube.com/watch?v=9TxvWcXT-JM\u0026list=PLCl11UFjHurC0zJPiNF-rCbAFd2BGUBOe\u0026index=7)\t\n\t\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n\n### 3.1) References [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\t\n### Recommended Unofficial Documentation\n\n* [Microservices Structuring and Creation](https://www.youtube.com/watch?v=BnknNTN8icw\u0026t=5s)\n* [Resilience4j Development](https://www.youtube.com/watch?v=Z_viIJSGXJw\u0026list=PLq3uEqRnr_2GlhVSqltfLtpO8GF4VIICY\u0026index=1)\n* [Grafana Dashboard Setup](https://www.youtube.com/watch?v=4WWW2ZLEg74)\n* [Grafana Dashboard Setup/Config](https://www.youtube.com/watch?v=zTZe447nDhI)\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n\n\n\u003cbr\u003e\n\n## Section 4) Creation and Configuration of the InmuebleService Microservice Model from scratch\n\n\n### 4.0) InmuebleService Microservice Model [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\n#### 4.0.0) Creation and Configuration\n#### (Only code relevant to microservices will be explained and included, all explanations and steps from scratch for a REST API are included in another project..https://github.com/andresWeitzel/Api_Rest_Spring_Productos)\n\n\n* We create and configure a Spring Started Proyect ( Name: InmuebleService | Group: com.inmueble.service | Package : com.inmueble.service )\n* From the project configuration, we add the spring web, spring data jpa, postgresql driver and Lombok dependencies\n\n```xml\n\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-boot-starter-data-jpa\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-boot-starter-web\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.postgresql\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003epostgresql\u003c/artifactId\u003e\n\t\t\t\u003cscope\u003eruntime\u003c/scope\u003e\n\t\t\u003c/dependency\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.projectlombok\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003elombok\u003c/artifactId\u003e\n\t\t\t\u003coptional\u003etrue\u003c/optional\u003e\n\t\t\u003c/dependency\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-boot-starter-test\u003c/artifactId\u003e\n\t\t\t\u003cscope\u003etest\u003c/scope\u003e\n\t\t\u003c/dependency\u003e\n```\n\n\u003c/br\u003e\n\n#### Lombok Configuration\n* After having the jars through the dependency in our project, we will install Lombok to be able to use it, it is not enough just to download, we need to configure and download it on our computer.\n* We search for the jar in Maven Dependencies `lombok-1.18....` Right-click and properties\n* Tab Java Source Attachment and we search for the Path where the jar of Lombok was downloaded.\n* We go to that folder, in my case `C:\\Users\\andre\\.m2\\repository\\org\\projectlombok\\lombok\\1.18.22` and we execute the Lombok jar `lombok-1.18.22.jar`\n* WE WILL PERFORM THE INSTALLATION IN THE CONFIGURATION FOLDER OF OUR IDE BY SELECTING SPECIFY LOCATION, IN MY CASE SPRING TOOL SUITE `C:\\Program Files (x86)\\sts-4.13.1.RELEASE`\n* We install, next next...\n* We close and reopen the IDE for the changes to take effect correctly\n\n\n\u003cbr\u003e\n\n\n#### 4.0.1) Enums\n#### (Only code relevant to microservices will be explained and included, all explanations and steps from scratch for a REST API are included in another project..https://github.com/andresWeitzel/Api_Rest_Spring_Productos)\n* Inside the `com.inmueble.service` package hierarchy, we create the `enums` package\n* We will create an enumerated class for the `estado_inmueble_enum` field of the `Inmueble` entity we will create next\n* Inside the `enum` package, we create the `EstadoInmuebleEnum` class\n* For this class, we do not add the @Entity annotation of JPA since we are not going to create a table in the database, but instead use the possible values of the enumerations\n* We add the types of enumerations available for use from the database..\n ```java\n \n\n package com.inmueble.service.enums;\n \n\n\npublic enum EstadoInmuebleEnum {\n\tVENDIDO, DISPONIBLE, NO_DISPONIBLE, FALTA_INSPECCION;\n\n}\n\n ```\n \n \u003cbr\u003e\n\n\n#### 4.0.2) Entities\n\n* Inside the `com.inmueble.service` package hierarchy, we create the `entity` package\n* Inside the same `Inmueble` class\n* We add the corresponding annotations of the class for JPA \n* We model the inmuebles table of the db `db_inmuebles_microservicios`\n* We also add the necessary annotations for the fields, subsequently `@Enumerated(EnumType.STRING)` for the enumerated. We do not add the rest of the annotations since we are going to implement Lombok\n* Then we add the annotations for Lombok `@Data` , `@AllArgsConstructor` and `@NoArgsConstructor` , the first one for generating getters and setters and the rest of the methods, the second one for the overloaded constructors of the Entity and the third one for the empty constructor \n\n \n ```java\npackage com.inmueble.service.entity;\n\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.EnumType;\nimport javax.persistence.Enumerated;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.GenerationType;\nimport javax.persistence.Id;\nimport javax.persistence.Table;\n\nimport com.inmueble.service.enums.EstadoInmuebleEnum;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n@Table(name=\"inmuebles\")\n@Entity\n@Data\n@AllArgsConstructor\n@NoArgsConstructor\npublic class Inmueble {\n\t\n\t\n\t@GeneratedValue(strategy = GenerationType.AUTO)\n\t@Id\n\t@Column(name=\"id\")\n\tprivate int id;\n\t\n\t@Column(name=\"id_propietario_inmueble\")\n\tprivate int idPropietarioInmueble;\n\t\n\t@Column(name=\"descripcion\")\n\tprivate String descripcion;\n\t\n\t@Column(name=\"tipo\")\n\tprivate String tipo;\n\t\n\t@Enumerated(EnumType.STRING)\n\t@Column(name=\"estado_inmueble\")\n\tprivate EstadoInmuebleEnum  estadoInmuebleEnum;\n\t\n\t@Column(name=\"precio_inmueble_usd\") \n\tprivate double precioInmuebleUsd;\n\t\n\t@Column(name=\"direccion\")\n\tprivate String direccion;\n\t\n\t@Column(name=\"ubicacion\")\n\tprivate String ubicacion;\n\t\n\t@Column(name=\"sitio_web\")\n\tprivate String sitioWeb;\n\n}\n\n\n ```\n\n \n \u003cbr\u003e\n\n\n#### 4.0.3) Interfaces\n\n* Inside the `com.inmueble.service` package hierarchy, we create the `repository` package\n* Inside the same `I_InmuebleRepository` interface\n* We add the @Repository annotation of the class for JPA and we use the `JpaRepository\u003cInmuebleEntity, Serializable\u003e` interface along with the Pagination `PagingAndSortingRepository\u003cInmueble, Long\u003e` interface for all the functionality for creating the Jpa methods.\n* We create and define all the abstract methods making reference to the tentative fields of the entity. \n* We do not create the CRUD methods in the interface, since we declare all the abstract methods without return values. The `findAll` method will be for Paginated..\n \n ```java\npackage com.inmueble.service.repository;\n\nimport java.io.Serializable;\nimport java.util.List;\n\nimport org.springframework.data.domain.Page;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.data.jpa.repository.JpaRepository;\nimport org.springframework.data.repository.PagingAndSortingRepository;\nimport org.springframework.stereotype.Repository;\n\nimport com.inmueble.service.entity.Inmueble;\nimport com.inmueble.service.enums.EstadoInmuebleEnum;\n\n@Repository\npublic interface I_InmuebleRepository extends JpaRepository\u003cInmueble, Serializable\u003e, PagingAndSortingRepository\u003cInmueble, Serializable\u003e {\n\n\t\n\t//============================ MÉTODOS DE BÚSQUEDA ============================== \n\t\n\tpublic abstract Inmueble findById(int id);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByIdPropietarioInmueble(int id);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByDescripcion(String descripcion);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByTipo(String tipo);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByEstadoInmuebleEnum(EstadoInmuebleEnum  estadoInmuebleEnum);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByPrecioInmuebleUsd(double precioInmueble);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByDireccion(String direccion);\n\t\n\tpublic abstract List\u003cInmueble\u003e findByUbicacion(String ubicacion);\n\t\n\tpublic abstract List\u003cInmueble\u003e findBySitioWeb(String sitioWeb);\n\n\tpublic abstract Page\u003cInmueble\u003e findAll(Pageable pageable);\n\t\n\t\n\t\n\t\n\n}\n\n\n ```\n \n \u003cbr\u003e\n\n\n#### 4.0.4) Services\n\n* Inside the `com.inmueble.service` package hierarchy, we create the `service` package\n* Inside the same `InmuebleService` class\n* We add the @Service annotation of the class making reference to Spring and @Autowired for implementing Dependency Injection of the created interface.\n* We use log4j for error logs in CRUD methods for persistence. \n* We develop the body of each method of the interface\n* Each CRUD method has its persistence check and will return a boolean according to the result of the operation, they can be modified to add greater security.\n \n ```java\npackage com.inmueble.service.service;\n\nimport java.util.List;\n\nimport org.apache.logging.log4j.Logger;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.stereotype.Service;\n\nimport com.inmueble.service.entity.Inmueble;\nimport com.inmueble.service.enums.EstadoInmuebleEnum;\nimport com.inmueble.service.repository.I_InmuebleRepository;\n\n@Service\npublic class InmuebleService {\n\t\n\t@Autowired\n\tprivate I_InmuebleRepository iInmuebleRepository;\n\t\n\t\n\t// ============= LOGS ========================\t\n\tprivate static final Logger logger = org.apache.logging.log4j.LogManager.getLogger(InmuebleService.class);\n\n\t\n\t// ============ MÉTODOS CRUD ==================\n\t\n\t// ----INSERT----\n\tpublic boolean addInmueble(Inmueble inmueble) {\n\t\ttry {\n\t\t\tif(inmueble == null) {\n\t\t\t\tlogger.error(\"ERROR addInmueble : EL INMUEBLE \" + inmueble+\" ES NULO!!\");\n\t\t\t\treturn false;\n\t\t\t}else {\n\t\t\t\tiInmuebleRepository.save(inmueble);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR addInmueble : EL INMUEBLE \" + inmueble+ \" NO SE HA INSERTADO EN LA DB!!\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t\n\t// ----UPDATE----\n\tpublic boolean updateInmueble(Inmueble inmueble) {\n\t\ttry {\n\t\t\tif(inmueble == null) {\n\t\t\t\tlogger.error(\"ERROR updateInmueble : EL INMUEBLE \" + inmueble + \" ES NULO!!\");\n\t\t\t\treturn false;\n\t\t\t}else {\n\t\t\t\tiInmuebleRepository.save(inmueble);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR updateInmueble : EL INMUEBLE \" + inmueble + \" NO SE HA ACTUALIZADO EN LA DB!!\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t// ----DELETE----\n\tpublic boolean deleteInmueble(int id) {\n\t\ttry {\n\t\t\tif(id == 0) {\n\t\t\t\tlogger.error(\"ERROR deleteInmueble : EL ID DEL INMUEBLE ES CERO!!\");\n\t\t\t\treturn false;\n\t\t\t}else {\n\t\t\t\tiInmuebleRepository.delete(iInmuebleRepository.findById(id));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR deleteInmueble : EL INMUEBLE CON EL ID \" + id + \" NO SE HA ELIMINADO DE LA DB!!\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t// ----SELECT----\n\tpublic List\u003cInmueble\u003e getAllInmueble(Pageable pageable){\n\t\t\n\t\treturn iInmuebleRepository.findAll(pageable).getContent();\n\t}\n\t\n\t// ============ MÉTODOS DE BÚSQUEDA ==================\n\t\n\t//----ID-----\n\tpublic Inmueble findById(int id) {\n\t\treturn iInmuebleRepository.findById(id);\n\t}\n\t\n\n\t//---- ID PROPIETARIO INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findByIdPropietarioInmueble(int id) {\n\t\treturn iInmuebleRepository.findByIdPropietarioInmueble(id);\n\t}\n\t\n\t\n\t//---- DESCRIPCION INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findByDescripcion(String descripcion) {\n\t\treturn iInmuebleRepository.findByDescripcion(descripcion);\n\t}\n\t\n\t//----- TIPO DE INMUEBLE --------\n\tpublic List\u003cInmueble\u003e findByTipo(String tipo) {\n\t\treturn iInmuebleRepository.findByTipo(tipo);\n\t}\n\t\n\t\n\t//---- ESTADO INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findByEstadoInmuebleEnum(EstadoInmuebleEnum estadoInmuebleEnum) {\n\t\treturn iInmuebleRepository.findByEstadoInmuebleEnum(estadoInmuebleEnum);\n\t}\n\t\n\t\n\t\n\t//---- PRECIO INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findByPrecioInmueble(double precio) {\n\t\treturn iInmuebleRepository.findByPrecioInmuebleUsd(precio);\n\t}\n\t\n\t//---- DIRECCION INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findByDireccion(String direccion) {\n\t\treturn iInmuebleRepository.findByDireccion(direccion);\n\t}\n\t\n\t//---- UBICACION INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findByUbicacion(String ubicacion) {\n\t\treturn iInmuebleRepository.findByUbicacion(ubicacion);\n\t}\n\t\n\t//---- SITIO WEB INMUEBLE-----\n\tpublic List\u003cInmueble\u003e findBySitioWeb(String sitioWeb) {\n\t\treturn iInmuebleRepository.findBySitioWeb(sitioWeb);\n\t}\n\t\t\n\t\t\n\t\n\t\n\t\n}\n\n ```\n \n \u003cbr\u003e\n\n\n#### 4.0.5) Value Objects\n#### (The value objects will allow us to relate the microservices through our REST service guaranteeing maximum expressiveness of our code)\n\n\u003c/br\u003e \n\n* We create the `valueobjects` package inside the conventional route\n* We create the `PropietarioInmuebleVO` class \n* IT IS NECESSARY TO KNOW THE ATTRIBUTES OF THE MICROSERVICE ENTITY `PropietarioInmuebleService` TO COPY THE SAME FROM THE ORIGINAL ENTITY CLASS WITHOUT ANNOTATIONS, EXCEPT FOR LOMBOK, SINCE IT WILL BE A POJO CLASS.\n* This step of value objects is added here for organizational code purposes, both microservices can be developed and then this step can be performed, issues of convenience.\n\n\n```java\npackage com.inmueble.service.valueobjects;\n\nimport java.time.LocalDate;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n\n\n@Data\n@AllArgsConstructor\n@NoArgsConstructor\npublic class PropietarioInmuebleVO {\n\n\tprivate int id;\n\n\tprivate String nombre;\n\n\tprivate String apellido;\n\n\tprivate int edad;\n\n\tprivate LocalDate fechaNacimiento;\n\n\tprivate String tipoDocumento;\n\n\tprivate String nroDocumento;\n\n\tprivate String direccion;\n\n\tprivate String nroTelefonoPrincipal;\n\n\tprivate String nroTelefonoSecundario;\n\n\tprivate String email;\n\n}\n\n```\n\n\n \u003cbr\u003e\n\n\n#### 4.0.6) Template Value Objects\n#### (This Class will be the template that contains the Inmueble and PropietarioInmuebleVO objects)\n\n* Inside the `valueobjects` package, we create the template class `PropietarioInmuebleResponseTemplate`\n* We apply all the necessary Lombok annotations\n* ALIKE THE PREVIOUS STEP, IT IS NECESSARY TO HAVE PART OF THE OTHER MICROSERVICE DEVELOPED TO WORK WITH THE SAME\n* We use the already mentioned classes and apply Lombok\n* Code..\n\n```java\npackage com.inmueble.service.valueobjects;\n\nimport com.inmueble.service.entity.Inmueble;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n\n@Data\n@AllArgsConstructor\n@NoArgsConstructor\npublic class PropietarioInmuebleResponseTemplate {\n\t\n\tprivate PropietarioInmuebleVO propietarioInmuebleVO;\n\t\n\tprivate Inmueble inmueble;\n\t\n\n}\n\n```\n\n \u003cbr\u003e\n\n\n#### 4.0.7) Controllers\n\n \n* Inside the `com.inmueble.service` package hierarchy, we create the `controller` package\n* Inside the same `InmuebleController` class\n* We add the @RestController annotation to the class making reference to the controller and the @RequestMapping annotation making reference to the main access route for Spring.\n* We implement `@Autowired` for Dependency Injection of the created service.\n* We use `@PostMapping` and `@GetMapping` for the use of the HTTP methods \n* We also use the `@RequestBody` annotation to recover the body of the HTTP request and the `@PathVariable` annotation for handling the declared variables\n* We use log4j for error logs in CRUD methods for persistence. \n* We develop the body of each method of the interface\n* Each CRUD method of HTTP type (POST, DELETE, PUT, GET) has its persistence check and the methods will return a boolean according to the result of the operation, less the get method that brings the Inmueble. The same can be modified to add greater security.\n* There will also be a method to obtain the template with the PropietarioInmueble and Inmueble objects\n \n ```java\n package com.inmueble.service.controller;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.web.bind.annotation.DeleteMapping;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.PutMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.inmueble.service.entity.Inmueble;\nimport com.inmueble.service.enums.EstadoInmuebleEnum;\nimport com.inmueble.service.service.InmuebleService;\n\n@RestController\n@RequestMapping(\"/inmuebles\")\npublic class InmuebleController {\n\n\t@Autowired\n\tprivate InmuebleService inmuebleService;\n\n\t// ======== HTTP METHODS ============\n\t// --POST--\n\t@PostMapping(\"/\")\n\tpublic boolean addInmueble(@RequestBody Inmueble inmueble) {\n\n\t\treturn inmuebleService.addInmueble(inmueble);\n\n\t}\n\n\t// --PUT--\n\t@PutMapping(\"/\")\n\tpublic boolean updateInmueble(@RequestBody Inmueble inmueble) {\n\n\t\treturn inmuebleService.updateInmueble(inmueble);\n\n\t}\n\n\t// --DELETE--\n\t@DeleteMapping(\"/{id}\")\n\tpublic boolean deleteInmueble(@PathVariable(\"id\") int id) {\n\n\t\treturn inmuebleService.deleteInmueble(id);\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/listado\")\n\tpublic List\u003cInmueble\u003e getAll(Pageable pageable) {\n\t\treturn inmuebleService.getAllInmueble(pageable);\n\t}\n\n\t// ======== MÉTODOS DE BUSQUEDA ============\n\n\t// --GET--\n\t@GetMapping(\"/id/{id}\")\n\tpublic Inmueble findById(@PathVariable(\"id\") int id) {\n\n\t\treturn inmuebleService.findById(id);\n\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/id-propietario-inmueble/{id}\")\n\tpublic List\u003cInmueble\u003e findByIdPropietarioInmueble(@PathVariable(\"id\") int id) {\n\n\t\treturn inmuebleService.findByIdPropietarioInmueble(id);\n\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/descripcion/{descipcion}\")\n\tpublic List\u003cInmueble\u003e findByDescripcion(@PathVariable(\"descripcion\") String descripcion) {\n\n\t\treturn inmuebleService.findByDescripcion(descripcion);\n\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/tipo/{tipo}\")\n\tpublic List\u003cInmueble\u003e findByTipo(@PathVariable(\"tipo\") String tipo) {\n\n\t\treturn inmuebleService.findByTipo(tipo);\n\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/estado-inmueble/{estado-inmueble}\")\n\tpublic List\u003cInmueble\u003e findByEstadoInmuebleEnum(\n\t\t\t@PathVariable(\"estado-inmueble\") EstadoInmuebleEnum estadoInmuebleEnum) {\n\n\t\treturn inmuebleService.findByEstadoInmuebleEnum(estadoInmuebleEnum);\n\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/precio-inmueble/{precio-inmueble}\")\n\tpublic List\u003cInmueble\u003e findByPrecioInmueble(@PathVariable(\"precio-inmueble\") double precioInmueble) {\n\n\t\treturn inmuebleService.findByPrecioInmueble(precioInmueble);\n\n\t}\n\n\t// --GET--\n\t@GetMapping(\"/direccion/{direccion}\")\n\tpublic List\u003cInmueble\u003e findByDireccion(@PathVariable(\"direccion\") String direccion) {\n\n\t\treturn inmuebleService.findByDireccion(direccion);\n\n\t}\n\t\n\t// --GET--\n\t@GetMapping(\"/ubicacion/{ubicacion}\")\n\tpublic List\u003cInmueble\u003e findByUbicacion(@PathVariable(\"ubicacion\") String ubicacion) {\n\n\t\treturn inmuebleService.findByUbicacion(ubicacion);\n\n\t}\n\t\n\t\n\t// --GET--\n\t@GetMapping(\"/sitio-web/{sitio-web}\")\n\tpublic List\u003cInmueble\u003e findBySitioWeb(@PathVariable(\"sitio-web\") String sitioWeb) {\n\n\t\treturn inmuebleService.findBySitioWeb(sitioWeb);\n\n\t}\n\n}\n\n\n\n ```\n\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n\n\n\n### 4.1) Database configuration [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\t\n#### (The Microservice will persist data in this db, I will not detail how to start the db, execute the services, etc. All these steps are in the repository of the same..https://github.com/andresWeitzel/db_inmobiliaria_microservicios_postgres)\n\n\u003c/br\u003e\n\n* As mentioned, all steps for working with this db are in the respective repository, the relevant information will be the name and password of the db..\n```xml\nDatabase: db_inmobiliaria_microservicios\n\nContraseña:postgres\n```\n* To work with enumerations from postgres and from java, it is necessary to have a type conversion for correct synchronization and persistence, in addition to having added the corresponding annotations for enumerations from java, an cast is made from the db DDL, specifically `CREATE CAST (varchar AS estado_inmueble_enum) WITH INOUT AS IMPLICIT;\n`\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n### 4.2) application.properties configuration [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\t\n\n* Check Api Rest Repository for detailed information about the properties file\n* The only difference with the mentioned API REST is that I use MySQL instead of PostgreSQL, then the dialect for hibernate, port, etc. are changed.\n* We make the necessary configurations to work with the indicated database and the configurations that the database and spring require\n ```xml\n\n\nserver.port = 8092\nserver.error.whitelabel.enabled=true\n\nspring.datasource.url = jdbc:postgresql://localhost:5432/db_inmobiliaria_microservicios?serverTimezone=UTC\nspring.datasource.username = postgres\nspring.datasource.password = postgres\n\n\nspring.jpa.show-sql = true\nspring.jpa.hibernate.ddl-auto = update\nspring.jpa.hibernate.naming.strategy = org.hibernate.cfg.ImprovedNamingStrategy\nspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect\n\n\n\nspring.data.rest.page-param-name=page\nspring.data.rest.sort-param-name=sort\nspring.data.rest.limit-param-name=limit\nspring.data.rest.default-page-size = 1\nspring.data.rest.max-page-size = 10\n\n\n```\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n### 4.3) PostgreSQL management from cmd [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\t\n#### (This is a quick and effective way to check if we have tables, records, columns, etc. inserted in our database, previously and during the testing stage of the microservice, I recommend implementing this method)\n\n\u003c/br\u003e\n\n#### Implementation \n* We open a cmd as admin\n* Execute the following commands from the cmd\n\n#### Start PostgreSQL Service\n*  `psql -U postgres` \n*  Password for superuser `postgres`\n*  Or knowing the Postgres data directory..\n*  `pg_ctl -D \"C:/Program Files/PostgreSQL/13/data\" start` \n\n#### Show Data Directory\n* `show data_directory;`\n* The directory I will use is `C:/Program Files/PostgreSQL/13/data`\n* We will implement this path to check the status of the postgres service\n\n#### Stop PostgreSQL Service\n*  `exit`\n*  Or knowing the Postgres data directory..\n*  `pg_ctl -D \"C:/Program Files/PostgreSQL/13/data\" stop`\n*  Be careful with `Ctrl+c`, if used it stops the process abruptly and may leave as a zombie process (not finishing correctly). I do not recommend it\n\n#### Restart PostgreSQL Service\n*  `pg_ctl -D \"C:/Program Files/PostgreSQL/13/data\" restart`\n\n\n#### List Databases in the System\n* We list the dbs with the command `\\l`\n\n\n#### Change Database \n* With the command `\\c 'nombreDBSinComillas'`\n\n\n#### List Tables\n* With the command `\\dt`\n* ATTENTION, you must be in the db you want to visualize these tables, change db and execute this command again\n\n#### Description of the Table\n* With the command `\\d 'nombreTablaSinComillas'`\n\n#### Check the status of the Postgres Service\n* When we log in with the postgres user, the service should have started automatically, we will open another CMD and check this status\n*  `pg_ctl -D \"C:/Program Files/PostgreSQL/13/data\" status`\n*  We should get in the console that the service is active, something like this or similar\n* Result..\n```shell\n\npg_ctl: el servidor está en ejecución (PID: 6408)\nC:/Program Files/PostgreSQL/13/bin/postgres.exe \"-D\" \"C:\\Program Files\\PostgreSQL\\13\\data\"\n\n```\n\n#### Postgres SQL Commands\n* All commands that can be implemented with Postgres from any editor are completely valid from the cmd, if we want to list all the inmuebles `select * from inmuebles`, if we want to delete a table `drop table inmuebles`, etc\n\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n### 4.4) Functionality testing [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\t\n#### (We will test the methods developed with Postman, it is important that the steps mentioned above have been executed correctly and that the db is running with its records and tables correctly)\n\n \u003c/br\u003e\n\n* We test the POST method of inserting records by the following uri `http://localhost:8092/inmuebles/` and adding in the Body in Json format the Insertion Record..\n ```json\n {\n    \"idPropietarioInmueble\" : 1,\n    \"descripcion\" : \"Departamento de 1 Ambiente\",\n    \"tipo\" : \"Depto\",\n    \"estadoInmuebleEnum\" : \"DISPONIBLE\",\n    \"precioInmuebleUsd\" : 90000,\n    \"direccion\" : \"San Amadeo del Valle 908\",\n    \"ubicacion\" : \"Villa Crespo\",\n    \"sitioWeb\" : \"-\" \n\n}\n ```\n * We get a Status 200 OK along with the true returned by the developed method.\n * The function executes correctly.\n \n  \u003c/br\u003e\n  \n  * We test the GET method along with the created pagination to visualize the products of the db with the following uri `http://localhost:8092/inmuebles/listado?page=0\u0026size=0`\n * We can get more information in the Project that is attached on API Rest about the use of paginators \n * We get a Status 200 OK along with the total list of inmuebles(previously we have performed tests, so the id's and values are not logical)\n  ```json\n[\n    {\n        \"id\": 1,\n        \"idPropietarioInmueble\": 1,\n        \"descripcion\": \"PH de 4 Ambientes, 3 dormis, 2 baños, Amplio Espacio,jardin y balcon, Sin Expensas, Lujoso\",\n        \"tipo\": \"PH/Casa\",\n        \"estadoInmuebleEnum\": \"DISPONIBLE\",\n        \"precioInmuebleUsd\": 177.0,\n        \"direccion\": \"San Cristobla 456\",\n        \"ubicacion\": \"Palermo\",\n        \"sitioWeb\": \"www.avisosAlInstante.com.ar\"\n    },\n    {\n        \"id\": 2,\n        \"idPropietarioInmueble\": 2,\n        \"descripcion\": \"Casa 3 Ambientes, 4 Dormitorios, 1 baño y Cochera\",\n        \"tipo\": \"Casa\",\n        \"estadoInmuebleEnum\": \"VENDIDO\",\n        \"precioInmuebleUsd\": 168.0,\n        \"direccion\": \"Aristobulo del Valle 608 \",\n        \"ubicacion\": \"Belgrano\",\n        \"sitioWeb\": \"www.avisosAlInstante.com.ar\"\n    },\n    {\n        \"id\": 3,\n        \"idPropietarioInmueble\": 3,\n        \"descripcion\": \"Departamento de 2 Ambientes\",\n        \"tipo\": \"Departamento\",\n        \"estadoInmuebleEnum\": \"VENDIDO\",\n        \"precioInmuebleUsd\": 110.0,\n        \"direccion\": \"Av. Corrientes 112\",\n        \"ubicacion\": \"Caballito\",\n        \"sitioWeb\": \"www.avisosAlInstante.com.ar\"\n    },\n    {\n        \"id\": 13,\n        \"idPropietarioInmueble\": 1,\n        \"descripcion\": \"Departamento de 1 Ambiente\",\n        \"tipo\": \"Depto\",\n        \"estadoInmuebleEnum\": \"DISPONIBLE\",\n        \"precioInmuebleUsd\": 90000.0,\n        \"direccion\": \"San Amadeo del Valle 908\",\n        \"ubicacion\": \"Villa Crespo\",\n        \"sitioWeb\": \"-\"\n    }\n]\n ```\n \n \n  \u003c/br\u003e\n  \n  * We have tested in advance all the GET methods of type ( findByDescripcion, findByTipo, etc) through their corresponding URIS, if we want to search for Inmuebles according to their description, the URI would be `http://localhost:8092/inmuebles/descripcion/\"descripcion completa del inmueble sin comillas\"`.\n * For each search method, the specific URI will change\n\n  \n  \u003c/br\u003e\n  \n  * Now we test the PUT method, we will modify the Inmueble with id 13 through the following uri `http://localhost:8092/inmuebles/`, passing in the body the complete record along with its modification (estadoInmuebleEnum) ..\n  ```json\n {\n    \"id\" : 13,\n    \"idPropietarioInmueble\" : 1,\n    \"descripcion\" : \"Departamento de 1 Ambiente\",\n    \"tipo\" : \"Depto\",\n    \"estadoInmuebleEnum\" : \"NO_DISPONIBLE\",\n    \"precioInmuebleUsd\" : 90000,\n    \"direccion\" : \"San Amadeo del Valle 908\",\n    \"ubicacion\" : \"Villa Crespo\",\n    \"sitioWeb\" : \"-\" \n\n}\n  \n  ```\n  * We get a Status 200 OK and a true, if we visualize the list with the GET we will see the modification made\n  \n  \u003c/br\u003e\n  \n  * We test the DELETE method, we will delete the last modified record (id 13), through the following uri `http://localhost:8092/inmuebles/13`\n  * We get a Status 200 OK along with the true .\n  \n  \u003c/br\u003e\n  \n  * We bring the Inmuebles list with the GET to check tacitly what we have done `http://localhost:8092/inmuebles/listado?page=0\u0026size=0`..\n  \n  ```json\n[\n    {\n        \"id\": 1,\n        \"idPropietarioInmueble\": 1,\n        \"descripcion\": \"PH de 4 Ambientes, 3 dormis, 2 baños, Amplio Espacio,jardin y balcon, Sin Expensas, Lujoso\",\n        \"tipo\": \"PH/Casa\",\n        \"estadoInmuebleEnum\": \"DISPONIBLE\",\n        \"precioInmuebleUsd\": 177.0,\n        \"direccion\": \"San Cristobla 456\",\n        \"ubicacion\": \"Palermo\",\n        \"sitioWeb\": \"www.avisosAlInstante.com.ar\"\n    },\n    {\n        \"id\": 2,\n        \"idPropietarioInmueble\": 2,\n        \"descripcion\": \"Casa 3 Ambientes, 4 Dormitorios, 1 baño y Cochera\",\n        \"tipo\": \"Casa\",\n        \"estadoInmuebleEnum\": \"VENDIDO\",\n        \"precioInmuebleUsd\": 168.0,\n        \"direccion\": \"Aristobulo del Valle 608 \",\n        \"ubicacion\": \"Belgrano\",\n        \"sitioWeb\": \"www.avisosAlInstante.com.ar\"\n    },\n    {\n        \"id\": 3,\n        \"idPropietarioInmueble\": 3,\n        \"descripcion\": \"Departamento de 2 Ambientes\",\n        \"tipo\": \"Departamento\",\n        \"estadoInmuebleEnum\": \"VENDIDO\",\n        \"precioInmuebleUsd\": 110.0,\n        \"direccion\": \"Av. Corrientes 112\",\n        \"ubicacion\": \"Caballito\",\n        \"sitioWeb\": \"www.avisosAlInstante.com.ar\"\n    }\n]\n  ```\n\n* Our REST API meets the developed requirements\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\u003cbr\u003e\n\n## Section 5) Git usage and management\n\n\n### 5.0) Download [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\t\n* We go to https://git-scm.com/downloads and download the versioner\n* As with any application, next... next...\n* IMPORTANT:DO NOT HAVE DBEAVER OPEN DURING INSTALLATION, OTHERWISE IT WILL NOT RECOGNIZE THE PATH\n\n### Open a Git Console (Git Bash) from Windows\n* --\u003e We write Git Bash from the Windows search bar\n* --\u003e From the console, we write the cd command followed by the project path\n* --\u003e We must have the project path and paste it into the Git Bash\n* --\u003e Once inside the Project, we can use Git\n\n\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n### 5.1) Upload project to remote repository [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\n\n#### 1)We create a new repository on GitHub.\n\n#### 2)We initialize our local .git repository from the terminal.\n* git init\n\n#### 3)We add what we have developed to our local repo from the terminal.\n* git add *\n\n#### 4)We add what we have in our local repo to the working area from the terminal.\n* git commit -m \"add a comment between quotes\"\n\n#### 5)We tell git where our project will be stored(check your github repository which is the link to your project(this is in code)).\n* git remote add origin https://github.com/andresWeitzel/Microservicios_Spring_Cloud_Netflix_Spring_Boot\n\n#### 6)We upload our project.\n* git push -u origin master\n\n\t\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n### 5.2) Project repository update [🔝](#index-)\n\n\u003cdetails\u003e\n \u003csummary\u003eView Details\u003c/summary\u003e\n\n\n#### 1)We visualize the changes made locally\n* git status\n\n#### 2)We add what has been modified to the working area\n* git add *\n\n#### 3)We confirm the changes made\n* git commit -m \"your commit between quotes\"\n\n#### 4)We synchronize and bring all changes from the remote repository to the branch we are currently working on.\n##### (ONLY IF CHANGES WERE MADE FROM ANOTHER SIDE, ej: on github u/o/y a work team)\n* git pull https://github.com/andresWeitzel/Microservicios_Spring_Cloud_Netflix_Spring_Boot\n\n#### 5)We send all local changes to the repo on github\n* git push https://github.com/andresWeitzel/Microservicios_Spring_Cloud_Netflix_Spring_Boot\n\n#### 6) In extreme cases, we push the repository branch (Not recommended)\n* git push -f --set-upstream origin master\n\n\t\n \u003cbr\u003e\n\n\u003c/details\u003e\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresweitzel%2Fmicroservicios_spring_cloud_netflix_spring_boot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandresweitzel%2Fmicroservicios_spring_cloud_netflix_spring_boot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresweitzel%2Fmicroservicios_spring_cloud_netflix_spring_boot/lists"}