[WebPubSub] Support invokeEvent for WebPubSub client#48316
Open
MoChilia wants to merge 10 commits intoAzure:mainfrom
Open
[WebPubSub] Support invokeEvent for WebPubSub client#48316MoChilia wants to merge 10 commits intoAzure:mainfrom
invokeEvent for WebPubSub client#48316MoChilia wants to merge 10 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a preview, request/response-style upstream invocation API (invokeEvent) to the WebPubSub client, including new protocol frames, result/error models, and documentation/tests to support correlated invokeResponse handling.
Changes:
- Introduces
invokeEvent(sync) and supporting async implementation that awaits a correlatedinvokeResponse, pluscancelInvocation. - Adds new message models (
invoke,invokeResponse,cancelInvocation) and wires them into encoding/decoding. - Adds tests and README/sample snippets demonstrating invocation scenarios (success/error/json/timeout/cancel).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/webpubsub/azure-messaging-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/InvokeEventTests.java | Adds unit tests covering invoke success/error/json/timeout and cancelInvocation behavior. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/DecoderTests.java | Extends decoder tests to validate invokeResponse decoding for success/error/json payloads. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/samples/java/com/azure/messaging/webpubsub/client/ReadmeSamples.java | Adds README sample methods for invokeEvent, timeout usage, and cancellation. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/models/InvokeEventResult.java | Adds public model representing an invocation result payload. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/models/InvokeEventOptions.java | Adds public options bag for invocationId/timeout configuration. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/models/InvocationException.java | Adds public exception type for invocation failures/timeouts/service errors. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/implementation/models/WebPubSubMessage.java | Registers new message types in the discriminator-based message factory. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/implementation/models/InvokeResponseMessage.java | Implements invokeResponse frame serialization/deserialization. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/implementation/models/InvokeMessage.java | Implements outbound invoke frame shape used by invokeEvent. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/implementation/models/CancelInvocationMessage.java | Implements outbound cancelInvocation frame. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/implementation/MessageEncoder.java | Ensures invoke frames have their payload normalized similarly to other outbound message types. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/WebPubSubClient.java | Adds public sync invokeEvent overloads and cancelInvocation. |
| sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/WebPubSubAsyncClient.java | Adds internal reactive implementation for invoke/cancel and an InvokeResponseMessage sink. |
| sdk/webpubsub/azure-messaging-webpubsub-client/README.md | Documents preview invoke/cancel APIs with code snippets. |
.../src/main/java/com/azure/messaging/webpubsub/client/implementation/models/InvokeMessage.java
Outdated
Show resolved
Hide resolved
...ng-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/InvokeEventTests.java
Show resolved
Hide resolved
...ebpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/WebPubSubAsyncClient.java
Outdated
Show resolved
Hide resolved
...ebpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/WebPubSubAsyncClient.java
Show resolved
Hide resolved
...ng-webpubsub-client/src/samples/java/com/azure/messaging/webpubsub/client/ReadmeSamples.java
Outdated
Show resolved
Hide resolved
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.
Description
Adds a preview request-response style
invokeEventAPI to the WebPubSub client, allowing users to invoke an upstream event and await a correlated response from the service.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines