{"id":19140343,"url":"https://github.com/cochachyle-dev/proyectobancos1-service1","last_synced_at":"2026-06-04T16:31:11.633Z","repository":{"id":174840083,"uuid":"532119046","full_name":"cochachyLE-Dev/ProyectoBancoS1-Service1","owner":"cochachyLE-Dev","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-12T14:33:55.000Z","size":574,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T19:13:03.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cochachyLE-Dev.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":"2022-09-03T00:55:40.000Z","updated_at":"2023-06-12T23:38:37.000Z","dependencies_parsed_at":"2023-07-14T07:50:20.593Z","dependency_job_id":null,"html_url":"https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1","commit_stats":null,"previous_names":["cochachyle-dev/proyectobancos1-service1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cochachyLE-Dev/ProyectoBancoS1-Service1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cochachyLE-Dev%2FProyectoBancoS1-Service1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cochachyLE-Dev%2FProyectoBancoS1-Service1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cochachyLE-Dev%2FProyectoBancoS1-Service1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cochachyLE-Dev%2FProyectoBancoS1-Service1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cochachyLE-Dev","download_url":"https://codeload.github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cochachyLE-Dev%2FProyectoBancoS1-Service1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33914543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"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":[],"created_at":"2024-11-09T07:17:13.206Z","updated_at":"2026-06-04T16:31:11.594Z","avatar_url":"https://github.com/cochachyLE-Dev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Diagram-Arquitecture.PNG)\n\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-Hystrix-Stream.PNG)\n\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-Hystrix-Stream-Postman-2.PNG)\n\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-Hystrix-Stream-Postman-3.PNG)\n\n\nNo se registra el servicio \"Service1\" en Eureka, es innecesario. Se usa EurekaClient para acceder a las instancias del servicio para luego usarlas en el Balanceador de carga.\n\nConfiguración básica de EurekaClient\n```yaml\neureka:   \n  client:    \n    register-with-eureka: false  # No registra el servicio en Eureka\n    serviceUrl:\n      defaultZone: http://localhost:8761/eureka\n```\n\nConfiguración personalizada del Balanceador de carga [Service1.yml].\nEs necesario especificar el tipo de protocolo \"http\" o \"https\" con la propiedad \u003cb\u003eEnabledSSL\u003c/b\u003e\n\n```yaml\nvaetech:\n  load-balancer:\n    instance1:\n      enabledSSL: false    # Especificar True cuando las instancias tienen un enlace seguro.\n    instance2:\n      enabledSSL: false    # Especificar True cuando las instancias tienen un enlace seguro.\n```\n\nConfiguration personalizada de Balanceador de carga para microservicio1, microservicio2, ....\u003c/br\u003e\nSe considera el despliegue de los microservicios en multiples servidores.\n\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-LoadBalancer-Microservice1.PNG)\n\nConfiguración personalizada del Balanceador de carga.\n\n```java\nclass ServiceInstanceListSupplier{\n\t\n\t@Autowired\n\tLoadBalancerInstanceConfig config;\n\t\n\t@Autowired\n    @Lazy\n    EurekaClient eurekaClient;\n\t\n\t@Bean\n\t@Primary\t\n\tServiceInstanceListSupplier serviceInstanceListSupplier() throws Exception {\n\t\tList\u003cInstanceInfo\u003e instanceInfoList = eurekaClient.getApplications()\n\t\t\t\t.getRegisteredApplications(WebClientInstanceConfig.InstanceName)\n\t\t\t\t.getInstances();\n\t\t\n\t\tif(instanceInfoList == null || instanceInfoList.size() == 0)\n\t\t\tthrow new Exception(\"instances not found.\");\n\t\t\n\t\tBoolean isSecure = config.getEnabledSSL();\n\t\tList\u003cTriplet\u003cString, Integer, Boolean\u003e\u003e instances = eurekaClient.getApplications()\n\t\t\t\t.getRegisteredApplications(WebClientInstanceConfig.InstanceName)\n\t\t\t\t.getInstances().stream()\n\t\t\t\t.filter(e -\u003e e.getStatus().equals(InstanceStatus.UP))\n\t\t\t\t.map(e -\u003e new Triplet\u003cString, Integer, Boolean\u003e(e.getIPAddr(), e.getPort(), isSecure)).toList();\n\t\t\n\t\tif(instances.size() == 0)\n\t\t\tthrow new Exception(\"no available instances found.\");\n\t\t\n\t\treturn new MicroServiceInstanceListSupplier(WebClientInstanceConfig.InstanceName, instances);\n\t}\n}\n```\n\nControlador de instancias para EurekaClient. La idea es mostrar las instancias de Service-Discovery en el Admin-Server [ProyectoBancoS1-AdminServer](https://github.com/cochachyLE-Dev/ProyectoBancoS1-AdminServer)\n\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-Instances.PNG)\n\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-EurekaClient.PNG)\n\nCon está vista se tendría una visión más completa del Service-Discovery.\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-AdminServer.PNG)\n\n\nConfiguración básica de Circuit Breaker\n\n```Java\n@Bean\t\nCustomizer\u003cReactiveResilience4JCircuitBreakerFactory\u003e defaultCustomizer() {\n    return factory -\u003e factory.configureDefault(id -\u003e new Resilience4JConfigBuilder(id)\n            .circuitBreakerConfig(CircuitBreakerConfig\n                    .custom()\n                    // slidingWindowSize: Configura el tamaño de la ventana deslizante que se utiliza para registrar el resultado de las llamadas cuando se cierra el disyuntor.\n                    .slidingWindowType(CircuitBreakerConfig.SlidingWindowType.TIME_BASED)\n                    .slidingWindowSize(10)\n                    // minimumNumberOfCalls: Configura el número máximo de llamadas después de la primera exception (disyuntor medio abierto).\n                    .minimumNumberOfCalls(5) \n                    // waitDurationInOpenState: Configura la duración del tiempo de espera antes de pasar de abierto a medio abierto.\n                    .waitDurationInOpenState(Duration.ofSeconds(15))\n                    // failureRateThreshold: Configura el umbral de tasa de errores en porcentaje.\n                    .failureRateThreshold(25)\n                    .build())\n            .timeLimiterConfig(TimeLimiterConfig.custom()\n                    // timeoutDuration: Configura la duración del tiempo de espera de respuesta del microservicio.\n                    .timeoutDuration(Duration.ofSeconds(1)) \n                    .build())\n            .build());\n}\n```\n\nConfiguración básica de Circuit Breaker - \u003cb\u003etimeoutDuration\u003c/b\u003e\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-CircuitBreaker-1.PNG)\n\nConfiguración básica de Circuit Breaker - \u003cb\u003eminimumNumberOfCalls\u003c/b\u003e\n![img](https://github.com/cochachyLE-Dev/ProyectoBancoS1-Service1/blob/main/Service1-CircuitBreaker-2.PNG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcochachyle-dev%2Fproyectobancos1-service1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcochachyle-dev%2Fproyectobancos1-service1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcochachyle-dev%2Fproyectobancos1-service1/lists"}