{"id":16422349,"url":"https://github.com/stephenhillier/groundwater","last_synced_at":"2026-04-15T11:35:24.565Z","repository":{"id":66138103,"uuid":"148576349","full_name":"stephenhillier/groundwater","owner":"stephenhillier","description":"microservices using wells \u0026 aquifers as example services","archived":false,"fork":false,"pushed_at":"2019-03-16T03:40:02.000Z","size":3635,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-11T18:35:10.044Z","etag":null,"topics":["cqrs","grpc","nats","openshift"],"latest_commit_sha":null,"homepage":"","language":"Go","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/stephenhillier.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":"2018-09-13T03:24:27.000Z","updated_at":"2024-06-19T10:18:40.634Z","dependencies_parsed_at":null,"dependency_job_id":"fde86fe6-241b-40d8-bb09-90914a0846bb","html_url":"https://github.com/stephenhillier/groundwater","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"a6bfa2fec87f21ae3e449865314b8270835e3831"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephenhillier/groundwater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fgroundwater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fgroundwater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fgroundwater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fgroundwater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenhillier","download_url":"https://codeload.github.com/stephenhillier/groundwater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fgroundwater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31839753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T11:29:19.690Z","status":"ssl_error","status_checked_at":"2026-04-15T11:29:19.171Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cqrs","grpc","nats","openshift"],"created_at":"2024-10-11T07:36:16.334Z","updated_at":"2026-04-15T11:35:24.549Z","avatar_url":"https://github.com/stephenhillier.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing gRPC / NATS / grpc-gateway services\n\nThis repo contains notes and testing for communication between microservices in a way that enables services to react to changes in other systems (e.g., we want the **wells** service to have an idea about which aquifers exist, and we want the **aquifers** service to know when new wells are dug into an aquifer).\n\nWe can choreograph the way systems respond to events (like the creation of a new well in the wells service) by ensuring each system knows what to do when something is created, updated, or removed in a service it is interested in.\nSee: https://microservices.io/patterns/data/saga.html\n\n## How to test with docker-compose:\n\n1. Clone repo\n2. run `docker-compose up`\n\nAs soon as the services start, a job container will start that will send 5 `create well` requests; you can observe the output from the wells and aquifers service.\n\n```\nrun-tests_1      | 2019/03/16 02:56:05 Running tests...\nrun-tests_1      | 2019/03/16 02:56:05 1. Create well\nrun-tests_1      | 2019/03/16 02:56:05   POST http://wells-gateway:8000/v1/wells\nwells_1          | 2019/03/16 02:56:05 created well 8491, publishing to stream...\naquifers_1       | 2019/03/16 02:56:05 received well created notification: {\"id\":8491,\"aquifer\":1,\"owner\":\"Johnny\",\"depth\":10.1}\n```\n\nThe aquifer system can now act on the information it received about a new well in aquifer `1`.\n\n## Ensuring data reaches the stream\n\nWhen a request for a new `Well` arrives, we don't need to place it on the event stream for the Wells service to pick up.  We can make a request directly to the **wells** service to create it. If an error occurs, the user can be notified immediately and no event needs to be placed onto the stream.\n\nAfter the well create request is successfully processed by the wells service, we should publish the `well-created` event onto the stream.\n\nTo ensure that the message makes it to the message server, we can place it in an \"outbox\" table in the wells service.  If the publish event was succesful, we can delete the message from the outbox.  If it fails, we can periodically retry sending messages in the outbox until we verify it was published succesfully.\n\nSee:\n* http://gistlabs.com/2014/05/the-outbox/\n* [Asyncronous Message-based communication](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/architect-microservice-container-applications/asynchronous-message-based-communication#resiliently-publishing-to-the-event-bus)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhillier%2Fgroundwater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenhillier%2Fgroundwater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhillier%2Fgroundwater/lists"}