diff --git a/sdk/webpubsub/azure-messaging-newwebpubsub/README.md b/sdk/webpubsub/azure-messaging-newwebpubsub/README.md index 017f23ff53004..63e9b890871c1 100644 --- a/sdk/webpubsub/azure-messaging-newwebpubsub/README.md +++ b/sdk/webpubsub/azure-messaging-newwebpubsub/README.md @@ -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 diff --git a/sdk/webpubsub/azure-messaging-newwebpubsub/src/samples/java/com/azure/messaging/newwebpubsub/ReadmeSamples.java b/sdk/webpubsub/azure-messaging-newwebpubsub/src/samples/java/com/azure/messaging/newwebpubsub/ReadmeSamples.java index f34361696765c..668bbf45706c7 100644 --- a/sdk/webpubsub/azure-messaging-newwebpubsub/src/samples/java/com/azure/messaging/newwebpubsub/ReadmeSamples.java +++ b/sdk/webpubsub/azure-messaging-newwebpubsub/src/samples/java/com/azure/messaging/newwebpubsub/ReadmeSamples.java @@ -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 } }