WebRtcEndpoint abd Redis

53 views
Skip to first unread message

Александр Миранович

unread,
Jan 11, 2023, 5:08:00 AM1/11/23
to kurento
Hi everyone!
At the moment I am trying to make my project more scallable and I wanna use Redis. The most important entity in project - UserSession which include all necessary info about user and session. So, I should save user's WebRtcEndpoint to Redis, but I got exception NotSerializableException. I work on Java and Spring Boot. Have anybody worked with same case? Thanks in advance.

Neil Young

unread,
Jan 11, 2023, 5:39:56 AM1/11/23
to kur...@googlegroups.com
I once have tried to JSON.stringify() such an object in NodeJS and got the same error due to circular references within that object. That is difficult to serialise. 



Am 11.01.2023 um 11:08 schrieb Александр Миранович <mir...@gmail.com>:

Hi everyone!
At the moment I am trying to make my project more scallable and I wanna use Redis. The most important entity in project - UserSession which include all necessary info about user and session. So, I should save user's WebRtcEndpoint to Redis, but I got exception NotSerializableException. I work on Java and Spring Boot. Have anybody worked with same case? Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/f78daf52-bc8b-47e1-b164-6f62f56f1b25n%40googlegroups.com.

Alejandro Sellero Rodríguez

unread,
Jan 11, 2023, 8:02:36 AM1/11/23
to kurento
I am not 100% sure right now, but I think there was a kind of getId method on MediaElement objects which should allowed you to get the MediaElement from Kurento with the kurento client method getById, in that case you would only need to persist this ID.
Maybe I misunderstood

Juan Navarro

unread,
Jan 20, 2023, 6:26:41 AM1/20/23
to kur...@googlegroups.com
Hi,

if you want to get an Id, the parent class MediaObject has just that:

https://doc-kurento.readthedocs.io/en/latest/_static/client-javadoc/org/kurento/client/MediaObject.html

But note that an Id is only useful to refer to an already existing object in the media server. Note that objects have a lot of state that cannot be just serialized and passed to a different instance of Kurento and say "hey this is a description of an object that I had in a different server, just recreate it"; that's not possible.

For example a WebRtcEndpoint will have varying levels of ICE candidate negotiations, RTP sequence numbering and clock skew detection, packet loss correction in coordination with the receiver web browser... all that stuff is simply not possible to replicate with a serialization of an object.

Apart from that, it depends on what you intend to achieve. Evicting already running objects from one media server to another is not practical, so a good idea is to have a fleet of media servers, and assign new sessions (for example videoconference rooms) to the less loaded ones, in a round-robin or more advanced algorithm. This is what we've been working on behind the scenes for the pro tier of OpenVidu, and it works great to have e.g. 3 media servers and one central application server that monitors their load and coordinates them.

A more advanced technique is to create a tree-like of media-servers which can join an already existing session and act as a relay for even more participants... this already existed as a (now abandoned) old project "Kurento-Tree", and is in the roadmap for future iterations of Openvidu.


Regards,
-- 
Juan Navarro
Software Development Engineer
Kurento & OpenVidu WebRTC platforms | https://openvidu.io/
On 11/01/2023 11.08, Александр Миранович wrote:
Hi everyone!
At the moment I am trying to make my project more scallable and I wanna use Redis. The most important entity in project - UserSession which include all necessary info about user and session. So, I should save user's WebRtcEndpoint to Redis, but I got exception NotSerializableException. I work on Java and Spring Boot. Have anybody worked with same case? Thanks in advance.

Neil Young

unread,
Jan 20, 2023, 7:20:56 AM1/20/23
to kurento
@Juan: Quite neat idea the thing with the Media Server chain (tree). Will try to keep that on top of my head.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages