# Build Azure Web PubSub Apps with Java

Real-time Java applications need secure, targeted messaging across WebSocket clients. This skill provides Azure Web PubSub patterns for clients, groups, tokens, permissions, async operations, and errors.

## Install

```bash
npx skillstore add sickn33/azure-messaging-webpubsub-java
```

## Metadata

- Status: approved
- Slug: sickn33-azure-messaging-webpubsub-java
- Skillstore revision: r2
- Version status: missing
- Tree hash: eb7dd2c876d9dddc38a46ef70ef6a8ba5fb0fb695293977cb0bd6339022b96da
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-messaging-webpubsub-java
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-messaging-webpubsub-java
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-messaging-webpubsub-java/manifest

## Capabilities

- Creates synchronous or asynchronous Azure Web PubSub clients using connection strings, access keys, or DefaultAzureCredential.
- Shows how to send text or JSON messages to all connections, groups, users, or individual connections.
- Explains group membership, connection checks, connection closure, and user presence operations.
- Demonstrates client access token creation with user identities, roles, groups, and expiration settings.
- Covers permission grants, revocation, checks, response filters, and basic HTTP error handling.

## Use Cases

- Add targeted application updates: Create Java service code that sends authorized notifications to selected users, connections, or groups.
- Standardize messaging integration: Define consistent client creation, authentication, async handling, and connection management patterns across services.
- Review token permissions: Evaluate access token roles, expiration, group scope, and permission grants before production release.

## Prompt Templates

### Create a service client

```
Show me how to create an Azure Web PubSub Java service client with DefaultAzureCredential for hub {hub_name}.
```

### Send group updates

```
Design Java code that sends {message_type} updates to group {group_name}. Include error handling and explain each required SDK type.
```

### Issue a scoped token

```
Create a short-lived token for user {user_id} that can only send to group {group_name}. Avoid broad roles and secret logging.
```

### Review a production design

```
Review this Azure Web PubSub Java design: {design}. Identify authorization, token handling, filtering, async, and connection lifecycle risks. Propose safer patterns.
```

## Limitations

- Provides examples and guidance only; it does not deploy Azure resources or run Java applications.
- Requires an existing Azure Web PubSub resource, valid credentials, and application-specific authorization decisions.
- Does not cover service provisioning, event handlers, client-side WebSocket code, monitoring, or production testing.
- SDK versions and Azure behavior may change, so verify generated code against current Microsoft documentation.

## Best Practices

- Use DefaultAzureCredential when possible, and keep connection strings or access keys outside source control.
- Grant group-scoped roles with short token lifetimes and authenticated user identities.
- Validate recipients, handle HTTP failures, and test disconnect behavior before production deployment.

## Anti Patterns

- Do not print token URLs, connection strings, access keys, or full authentication errors.
- Do not grant unscoped send or join roles when one group is sufficient.
- Do not broadcast user-controlled content without authorization, validation, and rate controls.

## Security Audit

- Audited at: 2026-07-23T20:47:47.657\+00:00
- Summary: All 37 external-command findings are false positives caused by Markdown fences or inline role names. The two URL findings are placeholder Azure endpoints, not outbound requests. The review found token URL logging and unscoped group roles in examples.

## Stats

- Views: 91
- Downloads: 10
- Favorites: 0
- Popularity score: 0
