justinmclean opened a new issue, #4699:
URL: https://github.com/apache/iggy/issues/4699
### Description
The Rust, Node, Java and C# examples show the message envelope pattern,
where each payload is wrapped in a JSON object with a `message_type` and a
`payload` string so one topic can carry several message kinds. The PHP examples
have only `getting-started` and `basic`.
### Affected area / component
PHP examples
### Proposed solution
Add `examples/php/message-envelope/producer.php` and `consumer.php`, and a
"Message Envelopes" section in `examples/php/README.md`.
- The helpers in `examples/php/src/common.php` (`iggy_client()`,
`ensure_stream_and_topic()`, `send_payloads()`, `example_payloads()`) already
do the set-up, so the work is the envelope encoding (`json_encode`) and the
consumer's `match` on `message_type`.
- Take the order types from `examples/node/src/message-envelope/`.
- A message with an unknown type is logged and skipped.
New PHP SDK calls are out of scope (#3302 tracks PHP parity).
**How to test:** build the extension with `cargo build` in `foreign/php`,
start a fresh server, and run both scripts with the same `-d
extension="${PHP_IGGY_EXTENSION:-...}"` form the README's other commands use.
### Good first issue
- [x] I think this could be a good first issue for a new contributor
--
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]