Repository navigation
feat: consume from NATS JetStream, and drop Pulsar - #15
Merged
Merged
Conversation
Adds serve-image-sync-nats alongside serve-image-sync-kafka, so staging can move while production keeps running Kafka untouched. image_processor_kafka becomes image_processor and takes the driver message as a type parameter. Nothing in it reads DriverMessage, RawData or Headers -- only Payload -- so the _kafka suffix described the signature rather than the logic, and it now serves both transports. No transform middleware, matching the Kafka handler. ep's processor hands the raw body to Event.Transform and both drivers pass it the same way, so Payload is populated identically. The CDC consumers need a transform only because their bodies carry a Debezium envelope; these are the sync services' own JSON. NATSSTREAMNAME is deliberately empty here, unlike the CDC consumers: image-sync is produced by the sync services, so no other stream declares it and the driver should create one from the subject rather than grafting it onto Debezium's. Pulsar goes: no Pulsar pods or ArgoCD apps exist. internal/producer and the pulsar processor were only reachable from the Pulsar handler. Builds on Go 1.25, since ep v2.3.0 requires go >= 1.24.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
🎉 This PR is included in version 1.16.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Same treatment as weeb-vip/anime-sync#22 and weeb-vip/character-staff-sync#8. Adds
serve-image-sync-natsalongsideserve-image-sync-kafka.image_processor_kafka→image_processorThe
_kafkasuffix described the signature, not the logic: a grep forDriverMessage,RawDataandHeaderscame back empty — it only readsPayload. So it takes the driver message as a type parameter and serves both transports:The old Pulsar-only
image_processorpackage is deleted, which freed the accurate name.No transform middleware — and that is correct
Unlike the CDC consumers, neither handler here has one.
ep's processor hands the raw body toEvent.Transform, and both drivers pass it identically:So
Payloadis populated the same way on both. The CDC consumers need a transform only because their bodies carry a Debezium{schema, payload}envelope;image-syncmessages are the sync services' own JSON.NATSSTREAMNAMEis empty here, on purposeThe CDC consumers bind to Debezium's
ANIMEDBSTAGINGstream. This one must not:image-syncis produced by the sync services, so nothing else declares a stream over it and the driver should create one from the subject. Naming Debezium's stream would graftimage-synconto a stream whose retention is sized for change events.Pulsar removed
No Pulsar pods, no Pulsar ArgoCD apps. Checked before deleting this time — the only two
pulsarmentions outside the handler were comments, not code, andimage_backfill's comment describes historical data shape (two producers keyed characters differently over time), so it stays. The stale one inimagepathnow says Kafka/NATS.Note for review
internal/worker/pool.goshows a 14-line diff I did not author —gofmt -wfixed pre-existing misformatting (&Pool[T] {→&Pool[T]{, field alignment) in a file that was unformatted onmain. Kept rather than reverted, since restoring badly-formatted code to keep a diff tidy is the wrong trade.Verification
go build,go vet,gofmtclean;go test ./...passes🤖 Generated with Claude Code