ThunderGod77 opened a new pull request, #4758: URL: https://github.com/apache/iggy/pull/4758
## Which issue does this PR address? Closes #4694 ## Rationale Adds a Go message envelope example, matching the Node one. ## What changed? Producer: wraps `OrderCreated`, `OrderConfirmed` and `OrderRejected` events in a JSON envelope (`message_type` + `payload`) and sends 5 batches of 10 messages to a single topic. Consumer: reads each envelope, uses `message_type` to pick the right struct, and decodes the payload into it. Unknown types are logged and skipped. Both are based on the getting-started example. When the README examples run in order against one server, stream `0` already holds plain-text messages from the getting-started producer, which the envelope consumer can't parse. This example uses its own stream and topic (`message-envelope-stream` / `message-envelope-topic`) to avoid them. ## Local Execution - Started a fresh server with `cargo run --bin iggy-server -- --fresh --with-default-root-credentials`, ran `go run ./message-envelope/producer/main.go` and then `go run ./message-envelope/consumer/main.go`, and confirmed in the logs that the consumer received the messages. - `./scripts/run-examples-from-readme.sh --language go` passes locally - `gofmt`, `go vet`, `golangci-lint` and `go mod tidy` are clean in `examples/go` ## AI Usage I used Claude Code. I wrote the first version of the producer and consumer, Claude reviewed it and also refactored minor parts of the code. I also ran the repo's `team-review` skill and made the changes. I reviewed every change and can explain each one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
