Azure Web PubSub for Java
A practical Java SDK guide for Azure Web PubSub messaging, groups, permissions, and real-time client access.
The evidence provides DefaultAzureCredential, managed identity, token-expiration, and least-role guidance, with environment-variable examples, and shows no malicious or covert exfiltration behavior. Points are deducted because secret storage, logging, and data-flow risks are not explained; an access-token URL is printed; role examples are broad; and externally visible operations such as closing connections lack confirmation, rollback, or recovery guidance.
The documentation covers major synchronous, asynchronous, messaging, group, connection, and error-handling paths, with a pinned dependency version. Points are deducted because there are no skill-specific tests or execution results in the supplied evidence; some examples have compilation uncertainty, such as a missing displayed Duration import in the token example; and abnormal-input handling is thin. Static calibration limits this dimension to 10, so the score remains 6.
The name, description, and trigger phrases clearly target Java Azure Web PubSub, WebSocket, chat, and live-push scenarios. Points are deducted because non-fit cases, input/output boundaries, and service prerequisites are not stated, and there is no Chinese-language or mainland-China reachability guidance. The core service depends on Azure Web PubSub, but the material does not establish availability in the target environment.
The skill includes installation, client creation, concepts, examples, environment variables, role references, best practices, and a dedicated references/examples.md file; license and version metadata are clear. Points are deducted for missing changelog, compatibility range, troubleshooting FAQ, named maintenance responsibility, and explicit update path. The reference material also duplicates much of the main document and leaves assumptions implicit.
The evidence indicates that the skill can provide directly usable snippets and a chat-service example for common Web PubSub Java tasks, so the core task is substantially covered. Points are deducted because no generated output or execution is verified, and some code may require additional imports, authentication decisions, production security controls, integration, and testing. Static calibration limits this dimension to 7, so the score remains 6.
The skill files, reference examples, and fixed revision provide auditable primary material with concrete code patterns. Points are deducted because there is no skill-specific test suite, CI coverage, or third-party execution evidence, and the supplied repository-level tests do not establish coverage of this skill. Static calibration limits this dimension to 5, so the score is 3.
- Avoid hard-coding, logging, or committing connection strings, access keys, or client-token URLs; verify their exposure scope.
- Closing connections, granting roles, and broadcasting to all connections have external effects and require application-level authorization, confirmation, auditing, and recovery controls.
- Compile the examples against azure-messaging-webpubsub 1.5.0 and add any missing imports, exception handling, and production configuration before adoption.
- Verify Azure Web PubSub reachability, regional availability, and compliance requirements for the intended deployment and mainland-China users.
What it does & when to use it
This skill helps Java developers build real-time web applications with the Azure Web PubSub SDK. It covers synchronous and asynchronous client creation, authentication, text and JSON messaging, group and connection management, and user-targeted delivery. It also documents client access tokens, roles, environment variables, and HTTP error handling. Adopt it when your project already uses Azure Web PubSub and needs Java patterns for chat, live updates, or server-to-client notifications.
Shows how to add com.azure:azure-messaging-webpubsub:1.5.0 with Maven and create synchronous or asynchronous clients using a connection string, access key, or DefaultAzureCredential; send text and JSON messages to all connections, filtered connections, groups, individual connections, or users; add, remove, and check group membership; inspect and close connections or user connections; generate client access tokens with user IDs, roles, groups, and expiration settings; grant, revoke, and check permissions; and handle HttpResponseException responses by reading status codes and error messages.
- A Java backend developer building chat functionality with group or user-targeted messaging.
- A real-time web application team broadcasting live status or content updates to connected clients.
- A product that needs session control through hubs, groups, user IDs, and connection IDs.
- A production Azure application using DefaultAzureCredential or managed identity for authentication.
- A service issuing client access tokens with roles or groups for browser-facing connections.
Pros & cons
- Covers broadcast, filtered delivery, groups, users, and individual connections.
- Includes both synchronous and asynchronous Java client examples.
- Documents connection management, client tokens, and fine-grained role permissions.
- Shows connection string, access-key, and DefaultAzureCredential authentication patterns.
- The skill and repository state that they use the MIT license.
- Focuses on the server-side Java SDK rather than a complete application or browser client.
- The source does not specify a Java version, Azure resource provisioning flow, or deployment process.
- No skill-specific test results or acceptance scenarios are provided in the source.
- Azure service pricing and quotas are outside the supplied material.
How to install
Install the repository collection using the documented command npx skills add microsoft/skills, then select the needed skill in the wizard. The skill is installed into the selected agent directory, such as .github/skills/ for GitHub Copilot. For the Java project, add com.azure:azure-messaging-webpubsub:1.5.0 to Maven pom.xml. The source does not document a separate installation command for this individual plugin skill.
How to use
After installing the skill into the agent configuration directory, trigger it with a prompt such as “Use Web PubSub Java to implement group-based JSON messaging for a chat backend” or “Implement real-time push notifications with Azure Web PubSub for Java.” Configure the connection string, endpoint, or access key required by the selected authentication method and set a hub in the client builder. The source does not define a platform-specific trigger configuration format.