- Java Development Kit (JDK) version 8 or above
- Apache Maven
- Create an Azure Web PubSub resource
Copy Connection String from Keys tab of the created Azure Web PubSub service to be used later.

Open a new terminal window, copy Connection String from Keys tab of the created Azure Web PubSub service, run the below command with the <connection-string> replaced by your Connection String:
cd logstream-webserver
mvn compile & mvn package & mvn exec:java -Dexec.mainClass="com.webpubsub.tutorial.App" -Dexec.cleanupDaemonThreads=false -Dexec.args="'<connection_string>'"Now open http://localhost:8080 in browser. If you are using Chrome, you can press F12 or right-click -> Inspect -> Developer Tools, and select the Network tab. Load the web page, and you can see the WebSocket connection is established. Click to inspect the WebSocket connection, you can see below connected event message is received in client. You can see that you can get the connectionId generated for this client.
{"type":"system","event":"connected","userId":null,"connectionId":"<the_connection_id>"}Start a new terminal window:
cd logstream-streaming
mvn compile & mvn package & mvn exec:java -Dexec.mainClass="com.webpubsub.quickstart.App" -Dexec.cleanupDaemonThreads=falseType any text and they'll be displayed in the browser in real time.