Skip to content

Commit

Permalink
add sample
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft committed Jan 13, 2022
1 parent b71b9d4 commit 9b49801
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/webpubsub/azure-messaging-newwebpubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Various documentation is available to help you get started
## Examples

```java com.azure.messaging.newwebpubsub.readme
WebPubSubClient client = new WebPubSubClientBuilder()
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildWebPubSubClient();
boolean userExists = client.userExistsWithResponse("hub", "user_id", null).getValue();
```

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@

package com.azure.messaging.newwebpubsub;

import com.azure.core.util.Configuration;

public final class ReadmeSamples {
public void readmeSamples() {
// BEGIN: com.azure.messaging.newwebpubsub.readme
WebPubSubClient client = new WebPubSubClientBuilder()
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildWebPubSubClient();
boolean userExists = client.userExistsWithResponse("hub", "user_id", null).getValue();
// END: com.azure.messaging.newwebpubsub.readme
}
}

0 comments on commit 9b49801

Please sign in to comment.