{"id":22712334,"url":"https://github.com/jonathanmdr/resilience-http-client","last_synced_at":"2025-08-05T12:13:24.135Z","repository":{"id":265263699,"uuid":"895615136","full_name":"jonathanmdr/resilience-http-client","owner":"jonathanmdr","description":"Sample project to explain about resilient patterns for integration distributed services","archived":false,"fork":false,"pushed_at":"2025-03-19T00:41:03.000Z","size":42717,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T01:33:43.592Z","etag":null,"topics":["api-rest","clean-architecture","ddd","java","kafka","maven","modular-architecture","monorepo","mysql","spring-boot","testing","worker"],"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/jonathanmdr.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":"2024-11-28T14:39:13.000Z","updated_at":"2025-03-19T00:41:07.000Z","dependencies_parsed_at":"2024-12-16T13:56:20.092Z","dependency_job_id":"9001e6a9-0163-4ada-b8f3-c2c4d973d4f3","html_url":"https://github.com/jonathanmdr/resilience-http-client","commit_stats":null,"previous_names":["jonathanmdr/resilience-http-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanmdr%2Fresilience-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanmdr%2Fresilience-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanmdr%2Fresilience-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanmdr%2Fresilience-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanmdr","download_url":"https://codeload.github.com/jonathanmdr/resilience-http-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246250135,"owners_count":20747298,"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-rest","clean-architecture","ddd","java","kafka","maven","modular-architecture","monorepo","mysql","spring-boot","testing","worker"],"created_at":"2024-12-10T13:10:37.810Z","updated_at":"2025-08-05T12:13:24.125Z","avatar_url":"https://github.com/jonathanmdr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample of Resilience Patterns for Services Integration\n\u003e Explanations about patterns applied on API, HTTP Client, and Pub/Sub integrations.\n\n---\n\n## Project Structure\n![example of structure](.docs/img.png)\n\n## Profiles\n| Profile    | Description                                                                  |\n|------------|------------------------------------------------------------------------------|\n| `stack`    | Contains the stack of services that are used in the development environment. |\n| `services` | Contains the APIs and Workers that are used in the development environment.  |\n\n## Upping The Development Stack and Services Environment\n```shell\n# With docker-compose\ndocker-compose --profile stack --profile services up -d\n```\n```shell\n# With Make\nmake up\n```\n\n## Upping The Development Stack Environment Only\n```shell\n# With docker-compose\ndocker-compose --profile stack up -d\n```\n```shell\n# With Make\nmake up-stack\n```\n\n## Restarting The Development Stack and Services Environment\n```shell\n# With docker-compose\ndocker-compose --profile stack --profile services restart\n```\n```shell\n# With Make\nmake restart\n```\n\n## Restarting The Development Stack Environment Only\n```shell\n# With docker-compose\ndocker-compose --profile stack restart\n```\n```shell\n# With Make\nmake restart-stack\n```\n\n## Downing The Development Stack and Services Environment\n```shell\n# With docker-compose\ndocker-compose --profile stack --profile services down --remove-orphans --volumes\n```\n```shell\n# With Make\nmake down\n```\n\n## Downing The Development Stack Environment Only\n```shell\n# With docker-compose\ndocker-compose --profile stack down --remove-orphans --volumes\n```\n```shell\n# With Make\nmake down-stack\n```\n\n## Register CDC Source Connectors\n\u003e :information_source: _The connectors are not registered automatically when the stack is up. You should register them manually by running the following command bellow_\n```shell\n# With bash\n./connectors.sh\n```\n```shell\n# With Make\nmake connectors\n```\n\n## Downloading The OpenTelemetry Agent\n```shell\nmake otel-agent\n```\n\u003e :information_source: _Use the OTEL agent passing the java agent to the VM arguments: `-javaagent:.otel-dev/otel.jar`_\n\u003e \n\u003e :information_source: _To enable custom metrics using OTEL registry via Micrometer, pass the following value using the VM arguments: `-Dotel.instrumentation.micrometer.enabled=true`_\n\n## Open Telemetry Environment Variables Configuration\n\n### order-api\n```\nOTEL_EXPORTER_OTLP_METRICS_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics\nOTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative\nOTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces\nOTEL_METRICS_EXPORTER=otlp\nOTEL_TRACES_EXPORTER=otlp\nOTEL_LOGS_EXPORTER=none\nOTEL_METRIC_EXPORT_INTERVAL=15000\nOTEL_SERVICE_NAME=order-api\n```\n\n### authorization-api\n```\nOTEL_EXPORTER_OTLP_METRICS_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics\nOTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative\nOTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces\nOTEL_METRICS_EXPORTER=otlp\nOTEL_TRACES_EXPORTER=otlp\nOTEL_LOGS_EXPORTER=none\nOTEL_METRIC_EXPORT_INTERVAL=15000\nOTEL_SERVICE_NAME=authorization-api\n```\n\n### audit-api\n```\nOTEL_EXPORTER_OTLP_METRICS_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics\nOTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative\nOTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces\nOTEL_METRICS_EXPORTER=otlp\nOTEL_TRACES_EXPORTER=otlp\nOTEL_LOGS_EXPORTER=none\nOTEL_METRIC_EXPORT_INTERVAL=15000\nOTEL_SERVICE_NAME=audit-api\n```\n\n### order-worker\n```\nOTEL_EXPORTER_OTLP_METRICS_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics\nOTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative\nOTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces\nOTEL_METRICS_EXPORTER=otlp\nOTEL_TRACES_EXPORTER=otlp\nOTEL_LOGS_EXPORTER=none\nOTEL_METRIC_EXPORT_INTERVAL=15000\nOTEL_SERVICE_NAME=order-worker\n```\n\n### audit-worker\n```\nOTEL_EXPORTER_OTLP_METRICS_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics\nOTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative\nOTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces\nOTEL_METRICS_EXPORTER=otlp\nOTEL_TRACES_EXPORTER=otlp\nOTEL_LOGS_EXPORTER=none\nOTEL_METRIC_EXPORT_INTERVAL=15000\nOTEL_SERVICE_NAME=audit-worker\n```\n\n## Development Environment URLs\n| Host                                         | Description                       | Profiles   |\n|----------------------------------------------|-----------------------------------|------------|\n| http://localhost:8080                        | OpenAPI Order API                 | `services` |\n| http://localhost:8081                        | OpenAPI Authorization API         | `services` |\n| http://localhost:8082/graphiql               | GraphQL Audit API                 | `services` |\n| `noop`                                       | Order Worker                      | `services` |\n| `noop`                                       | Audit Worker                      | `services` |\n| `jdbc:mysql://localhost:3306/orders`         | Order Database                    | `stack`    |\n| `mongodb://root:root@localhost:27017/audit`  | Audit CDC Database                | `stack`    |\n| `jdbc:mysql://localhost:3307/authorizations` | Authorization Database            | `stack`    |\n| http://localhost:8580                        | Kafka UI                          | `stack`    |\n| http://localhost:8083                        | Kafka Connect API                 | `stack`    |\n| http://localhost:4317                        | OpenTelemetry GRPC Collector Port | `stack`    |\n| http://localhost:4318                        | OpenTelemetry HTTP Collector Port | `stack`    |\n| http://localhost:16666                       | Jaeger                            | `stack`    |\n| http://localhost:9090                        | Prometheus                        | `stack`    |\n| http://localhost:3000                        | Grafana                           | `stack`    |\n\n\n## Register the CDC Authorization Source Connector\n```shell\ncurl --request POST \\\n  --url http://localhost:8083/connectors \\\n  --header 'Accept: application/json' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"name\": \"authorizations-source-connector\",\n  \"config\": {\n    \"connector.class\": \"io.debezium.connector.mysql.MySqlConnector\",\n    \"database.hostname\": \"mysql-authorizations\",\n    \"database.port\": \"3306\",\n    \"database.user\": \"root\",\n    \"database.password\": \"root\",\n    \"database.server.id\": \"10000\",\n    \"database.include.list\": \"authorizations\",\n    \"table.ignore.broken.offsets\": \"true\",\n    \"table.include.list\": \"authorizations.authorizations\",\n    \"include.schema.changes\": \"false\",\n    \"schema.history.internal.kafka.bootstrap.servers\": \"kafka-broker:19092\",\n    \"schema.history.internal.kafka.topic\": \"connect-cdc-schema-history\",\n    \"topic.prefix\": \"authorizations\",\n    \"transforms\": \"RenameTopic\",\n    \"transforms.RenameTopic.type\": \"org.apache.kafka.connect.transforms.RegexRouter\",\n    \"transforms.RenameTopic.regex\": \".*\",\n    \"transforms.RenameTopic.replacement\": \"connect-cdc-authorization-events\",\n    \"snapshot.mode\": \"initial\",\n    \"max.batch.size\": \"2048\",\n    \"max.queue.size\": \"8192\",\n    \"poll.interval.ms\": \"1000\",\n    \"connect.timeout.ms\": \"30000\",\n    \"tombstones.on.delete\": \"false\"\n  }\n}'\n```\n\n## Register the CDC Order Source Connector\n```shell\ncurl --request POST \\\n  --url http://localhost:8083/connectors \\\n  --header 'Accept: application/json' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"name\": \"orders-source-connector\",\n  \"config\": {\n    \"connector.class\": \"io.debezium.connector.mysql.MySqlConnector\",\n    \"database.hostname\": \"mysql-orders\",\n    \"database.port\": \"3306\",\n    \"database.user\": \"root\",\n    \"database.password\": \"root\",\n    \"database.server.id\": \"10001\",\n    \"database.include.list\": \"orders\",\n    \"table.ignore.broken.offsets\": \"true\",\n    \"table.include.list\": \"orders.orders\",\n    \"include.schema.changes\": \"false\",\n    \"schema.history.internal.kafka.bootstrap.servers\": \"kafka-broker:19092\",\n    \"schema.history.internal.kafka.topic\": \"connect-cdc-schema-history\",\n    \"topic.prefix\": \"orders\",\n    \"transforms\": \"RenameTopic\",\n    \"transforms.RenameTopic.type\": \"org.apache.kafka.connect.transforms.RegexRouter\",\n    \"transforms.RenameTopic.regex\": \".*\",\n    \"transforms.RenameTopic.replacement\": \"connect-cdc-order-events\",\n    \"snapshot.mode\": \"initial\",\n    \"max.batch.size\": \"2048\",\n    \"max.queue.size\": \"8192\",\n    \"poll.interval.ms\": \"1000\",\n    \"connect.timeout.ms\": \"30000\",\n    \"tombstones.on.delete\": \"false\"\n  }\n}'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanmdr%2Fresilience-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanmdr%2Fresilience-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanmdr%2Fresilience-http-client/lists"}