Skip to content

Commit

Permalink
prepare webpubsub beta.5 release (#25033)
Browse files Browse the repository at this point in the history
* update changelog

* update readme
  • Loading branch information
weidongxu-microsoft authored Oct 26, 2021
1 parent 1040fff commit c3d8867
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
18 changes: 17 additions & 1 deletion sdk/webpubsub/azure-messaging-webpubsub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Release History

## 1.0.0-beta.5 (Unreleased)
## 1.0.0-beta.5 (2021-10-26)

### Features Added

- Added support for method `closeUserConnectionsWithResponse`, `closeGroupConnectionsWithResponse`, `closeAllConnectionsWithResponse` in `WebPubSubServiceClient` and `WebPubSubServiceAsyncClient`.

### Breaking Changes

- Renamed method `getAuthenticationToken` to `getClientAccessToken` in `WebPubSubServiceClient` and `WebPubSubServiceAsyncClient`.
- Type changed from `String` to `WebPubSubPermission` in method `checkPermissionWithResponse`, `grantPermissionWithResponse`, `revokePermissionWithResponse`, in `WebPubSubServiceClient` and `WebPubSubServiceAsyncClient`.
- Renamed class `WebPubSubAuthenticationToken` to `WebPubSubClientAccessToken`.
- Renamed method `getAuthToken` to `getToken` in `WebPubSubClientAccessToken`.

### Other Changes

#### Dependency Updates

- Updated `api-version` to `2021-10-01`.

## 1.0.0-beta.4 (2021-09-08)

Expand Down
31 changes: 10 additions & 21 deletions sdk/webpubsub/azure-messaging-webpubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,25 @@ requests, can also use Azure Web PubSub service.

### Create a Web PubSub client using connection string

<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L22-L25 -->
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L21-L24 -->
```java
WebPubSubServiceClient webPubSubServiceClient = new WebPubSubClientBuilder()
WebPubSubServiceClient webPubSubServiceClient = new WebPubSubServiceClientBuilder()
.connectionString("{connection-string}")
.hub("chat")
.buildClient();
```

### Create a Web PubSub client using access key

<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L32-L36 -->
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L31-L35 -->
```java
WebPubSubServiceClient webPubSubServiceClient = new WebPubSubClientBuilder()
WebPubSubServiceClient webPubSubServiceClient = new WebPubSubServiceClientBuilder()
.credential(new AzureKeyCredential("{access-key}"))
.endpoint("<Insert endpoint from Azure Portal>")
.hub("chat")
.buildClient();
```

### Create a Web PubSub Group client
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L43-L47 -->
```java
WebPubSubServiceClient webPubSubServiceClient = new WebPubSubClientBuilder()
.credential(new AzureKeyCredential("{access-key}"))
.hub("chat")
.buildClient();
WebPubSubGroup javaGroup = webPubSubServiceClient.getGroup("java");
```

## Key concepts

### Hub
Expand Down Expand Up @@ -100,28 +90,27 @@ A message is either an UTF-8 encoded string or raw binary data.

### Broadcast message to entire hub

<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L59-L59 -->
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L47-L47 -->
```java
webPubSubServiceClient.sendToAll("Hello world!");
webPubSubServiceClient.sendToAll("Hello world!", WebPubSubContentType.TEXT_PLAIN);
```

### Broadcast message to a group

<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L71-L72 -->
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L59-L59 -->
```java
WebPubSubGroup javaGroup = webPubSubServiceClient.getGroup("Java");
javaGroup.sendToAll("Hello Java!", WebPubSubContentType.TEXT_PLAIN);
webPubSubServiceClient.sendToGroup("java", "Hello Java!", WebPubSubContentType.TEXT_PLAIN);
```

### Send message to a connection

<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L84-L84 -->
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L71-L71 -->
```java
webPubSubServiceClient.sendToConnection("myconnectionid", "Hello connection!", WebPubSubContentType.TEXT_PLAIN);
```

### Send message to a user
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L96-L96 -->
<!-- embedme ./src/samples/java/com/azure/messaging/webpubsub/ReadmeSamples.java#L83-L83 -->
```java
webPubSubServiceClient.sendToUser("Andy", "Hello Andy!", WebPubSubContentType.TEXT_PLAIN);
```
Expand Down

0 comments on commit c3d8867

Please sign in to comment.