How can i get the no of live current streams viewers in my spring-boot App?

Actually i am integrating the web-rtc feature using java in my app. I have downloaded java sample and it is working correctly fine.Now i want something just like facebook video live streams no of viewers. Can someone can give the java code and some examples??

If you are using openvidu-java-client library, see method Session.getActiveConnections

https://docs.openvidu.io/en/2.14.0/api/openvidu-java-client/

Will return every active user, every one of them with all of their active Publishers and Susbcribers.