Skip to content

feat(php): add PHP message envelope example - #4718

Open
08abhinav wants to merge 3 commits into
apache:masterfrom
08abhinav:feat/php-message-envelope-example
Open

08abhinav wants to merge 3 commits into
apache:masterfrom
08abhinav:feat/php-message-envelope-example

Conversation

@08abhinav

Copy link
Copy Markdown

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.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

If AI was used to create this PR, you must run the team-review skill before opening it.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Nov 3, 2026
@justinmclean

Copy link
Copy Markdown
Member

Thanks @08abhinav. The PR Title and Pre-merge checks never started on your first push, so they show as waiting. Could you push again, rebased on the latest master or as an empty commit (git commit --allow-empty -m "ci: rerun checks"), so they run?

@08abhinav
08abhinav force-pushed the feat/php-message-envelope-example branch from 7a404f7 to fc3e9e0 Compare November 4, 2026 04:03

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address the issues below.

Comment thread examples/php/README.md Resolved
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Nov 4, 2026

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no findings in the reviewed changes.

@hubcio hubcio removed the S-waiting-on-author PR is waiting on author response label Nov 4, 2026
@hubcio hubcio changed the title feat(examples): add PHP message envelope example feat(python): add PHP message envelope example Nov 4, 2026
@hubcio hubcio changed the title feat(python): add PHP message envelope example feat(php): add PHP message envelope example Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP examples: add a message envelope producer and consumer

3 participants