08abhinav opened a new pull request, #4718:
URL: https://github.com/apache/iggy/pull/4718

   ## Which issue does this PR address?
   
   Closes #4699
   
   ## Rationale
   
   The Rust, Node, Java and C# examples show the message envelope pattern, but 
the PHP examples only had `getting-started` and `basic`. This adds the missing 
example without any new PHP SDK calls (parity work is tracked in #3302).
   
   ## What changed?
   
   The PHP examples had no demonstration of sending several message kinds 
through one topic. This adds `examples/php/message-envelope/producer.php` and 
`consumer.php`, which wrap each order payload (`OrderCreated`, 
`OrderConfirmed`, `OrderRejected`, taken from the Node example) in a 
`message_type` + `payload` JSON envelope. The consumer dispatches on 
`message_type` with `match`, and logs and skips unknown or malformed messages. 
A "Message Envelopes" section is added to `examples/php/README.md`.
   
   ## Local Execution
   
   - Passed (built the extension with `cargo build` in `foreign/php`, started a 
fresh server, ran producer then consumer: 6 messages handled, 2 of each type)
   - Also tested the unknown-type and malformed-message paths by temporarily 
adding a made-up `message_type` and a non-JSON payload; both were logged and 
skipped
   - Pre-commit hooks ran (`prek`)
   
   ## AI Usage
   
   AI was used to assist with repository exploration, implementation, and 
documentation.
   
   - Development assistance: Reviewed existing PHP and Rust examples while 
implementing the producer.
   - I reviewed the changes and can explain the implementation and its design 
decisions.


-- 
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]

Reply via email to