Repository navigation
Shared event contracts, health probes, gateway validation - #5
Open
coderconnoisseur wants to merge 1 commit into
Open
coderconnoisseur wants to merge 1 commit into
coderconnoisseur wants to merge 1 commit into
Conversation
pkg/events: one definition of Location, RideRequested, RidePriced, RideMatched and RideUnmatched with snake_case JSON tags and a `v` version field (1). Pricing, matching, assignment and api-gateway import these instead of keeping their own copies. This also fixes the RideId / RideID drift in pricing. Wire change: event JSON keys are now snake_case (ride_id, requested_at, matched_at, ...) and carry "v". Producers and consumers ship together, but drain and recreate ride.* topics (or reset consumer offsets) when deploying so old and new payloads are not mixed. pkg/health: Liveness (always 200) and Readiness (checks run concurrently under a timeout; 503 lists failing checks) plus a Kafka check that dials the first reachable broker. Served on /health and /ready by api-gateway, pricing, matching and assignment. Matching also checks Redis PING. api-gateway: coordinates are pointers so a valid 0 is accepted; lat must be within [-90, 90] and lng within [-180, 180], otherwise 400 with the offending field named. Dead code removed: api-gateway LogPublisher, pricing-service ports/, matching-service ports/consumer.go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #4 (`sync-master-phase1`, the Phase 1 follow-ups synced into `master`). Merge #4 first, then retarget this PR to `master`.
What changed
Deploy note: wire format change
Event JSON keys are now snake_case (`ride_id`, `requested_at`, `matched_at`, `driver_id`, `failed_at`, `surge_multiplier`, `pickup`, `drop`) and every event carries `"v": 1`. Previously keys were Go field names (`RideID`, `RequestedAt`, `MatchedAT`, ...).
Producers and consumers all ship in this PR, so a consistent deploy works. But drain and recreate the `ride.*` topics (or reset consumer-group offsets) before starting the new build, so old and new payloads are not mixed on the same topic.
Not in this PR