duplicate rtmp connection

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

duplicate rtmp connection

Juan Diego
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Mondain
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Tiago Daniel Jacobs
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Juan Diego
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Juan Diego
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Tiago Daniel Jacobs
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago

On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Juan Diego
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Rajdeep Rath

Hey..

Sorry looking at this very late. Ut would be great if you can explain once more what you trying to get working.

After you trying to repeat connection or are you trying to repeat stream on other servers ?


On Aug 26, 2016 9:40 PM, "Juan Diego" <[hidden email]> wrote:
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Juan Diego
Are you asking if I am trying to duplicate the connection or the streams?  What do you think is better?

On Fri, Aug 26, 2016 at 11:14 AM, Rajdeep Rath <[hidden email]> wrote:

Hey..

Sorry looking at this very late. Ut would be great if you can explain once more what you trying to get working.

After you trying to repeat connection or are you trying to repeat stream on other servers ?


On Aug 26, 2016 9:40 PM, "Juan Diego" <[hidden email]> wrote:
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Rajdeep Rath
Well that depends on what you need to achieve. Whether purpose is streaming or just data transmission. Either ways the best think is to duplicate the data you are concerned with rather that thinking of the word session.

If say I want a connection called joe, I can create a connection from client to red5 and onAppConnect add a connection attribute name-> joe. Then if I want to replicate this I would use a rtmp client to make a connection to other servers, passing that attribute along as parameters. On other server on connection success I can again store the attribute on the connection.

In red5 as a example if you pass a query string the connection object can retrieve that in java code. So if you connect to another server from this sever using the same url then the query params should be available on that server as well.

When replicating streams it would be best to replicate the connection data and then publish same stream to other server by same name. If possible also copy over the stream metadata as well.(advance)

Similarly you can design a strategy for replicating realtime data changes across servers almost instantly.

These are just some thoughts ... ,May or  May not be helpful depending upon what you need.
 Haven't worked on all these myself so I cant give code examples. Finally I would just say even though it's connection oriented don't think of it as session always when replicating. If it's helpful do let me know.

Regards
Rajdeep Rath

On Friday, August 26, 2016, Juan Diego <[hidden email]> wrote:
Are you asking if I am trying to duplicate the connection or the streams?  What do you think is better?

On Fri, Aug 26, 2016 at 11:14 AM, Rajdeep Rath <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;rajdeeprath@gmail.com&#39;);" target="_blank">rajdeeprath@...> wrote:

Hey..

Sorry looking at this very late. Ut would be great if you can explain once more what you trying to get working.

After you trying to repeat connection or are you trying to repeat stream on other servers ?


On Aug 26, 2016 9:40 PM, "Juan Diego" <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;juandiego83@gmail.com&#39;);" target="_blank">juandiego83@...> wrote:
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;tiago@imdt.com.br&#39;);" target="_blank">tiago@...> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;juandiego83@gmail.com&#39;);" target="_blank">juandiego83@...> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;tiago@imdt.com.br&#39;);" target="_blank">tiago@...> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;juandiego83@gmail.com&#39;);" target="_blank">juandiego83@...> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;red5interest%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Juan Diego
Rajdeep, thanks that was really usefull.  The only thing that I dont understand is in my app how do I get the Stream, which class manages that information.  Sorry if what I am saying sounds stupid. Does ApplicationAdapter has a Stream  or does "IConnection conn" manages?  What type of object are rtmp connections on red5?

On Fri, Aug 26, 2016 at 1:13 PM, Rajdeep Rath <[hidden email]> wrote:
Well that depends on what you need to achieve. Whether purpose is streaming or just data transmission. Either ways the best think is to duplicate the data you are concerned with rather that thinking of the word session.

If say I want a connection called joe, I can create a connection from client to red5 and onAppConnect add a connection attribute name-> joe. Then if I want to replicate this I would use a rtmp client to make a connection to other servers, passing that attribute along as parameters. On other server on connection success I can again store the attribute on the connection.

In red5 as a example if you pass a query string the connection object can retrieve that in java code. So if you connect to another server from this sever using the same url then the query params should be available on that server as well.

When replicating streams it would be best to replicate the connection data and then publish same stream to other server by same name. If possible also copy over the stream metadata as well.(advance)

Similarly you can design a strategy for replicating realtime data changes across servers almost instantly.

These are just some thoughts ... ,May or  May not be helpful depending upon what you need.
 Haven't worked on all these myself so I cant give code examples. Finally I would just say even though it's connection oriented don't think of it as session always when replicating. If it's helpful do let me know.

Regards
Rajdeep Rath

On Friday, August 26, 2016, Juan Diego <[hidden email]> wrote:
Are you asking if I am trying to duplicate the connection or the streams?  What do you think is better?

On Fri, Aug 26, 2016 at 11:14 AM, Rajdeep Rath <[hidden email]> wrote:

Hey..

Sorry looking at this very late. Ut would be great if you can explain once more what you trying to get working.

After you trying to repeat connection or are you trying to repeat stream on other servers ?


On Aug 26, 2016 9:40 PM, "Juan Diego" <[hidden email]> wrote:
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Rajdeep Rath

Perhaps you can look at this :
https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/proxy/StreamingProxy.java

And examples relating to that are here and there so you need to google.

Red5 connections are of interface IConnection so i would start there

http://red5.org/javadoc/red5-server-common/org/red5/server/api/class-use/IConnection.html

And explore all base and inherited implemented classes to get a good grasp of its capabilities.

Regards
Rajdeep Rath


On Aug 27, 2016 12:06 AM, "Juan Diego" <[hidden email]> wrote:
Rajdeep, thanks that was really usefull.  The only thing that I dont understand is in my app how do I get the Stream, which class manages that information.  Sorry if what I am saying sounds stupid. Does ApplicationAdapter has a Stream  or does "IConnection conn" manages?  What type of object are rtmp connections on red5?

On Fri, Aug 26, 2016 at 1:13 PM, Rajdeep Rath <[hidden email]> wrote:
Well that depends on what you need to achieve. Whether purpose is streaming or just data transmission. Either ways the best think is to duplicate the data you are concerned with rather that thinking of the word session.

If say I want a connection called joe, I can create a connection from client to red5 and onAppConnect add a connection attribute name-> joe. Then if I want to replicate this I would use a rtmp client to make a connection to other servers, passing that attribute along as parameters. On other server on connection success I can again store the attribute on the connection.

In red5 as a example if you pass a query string the connection object can retrieve that in java code. So if you connect to another server from this sever using the same url then the query params should be available on that server as well.

When replicating streams it would be best to replicate the connection data and then publish same stream to other server by same name. If possible also copy over the stream metadata as well.(advance)

Similarly you can design a strategy for replicating realtime data changes across servers almost instantly.

These are just some thoughts ... ,May or  May not be helpful depending upon what you need.
 Haven't worked on all these myself so I cant give code examples. Finally I would just say even though it's connection oriented don't think of it as session always when replicating. If it's helpful do let me know.

Regards
Rajdeep Rath

On Friday, August 26, 2016, Juan Diego <[hidden email]> wrote:
Are you asking if I am trying to duplicate the connection or the streams?  What do you think is better?

On Fri, Aug 26, 2016 at 11:14 AM, Rajdeep Rath <[hidden email]> wrote:

Hey..

Sorry looking at this very late. Ut would be great if you can explain once more what you trying to get working.

After you trying to repeat connection or are you trying to repeat stream on other servers ?


On Aug 26, 2016 9:40 PM, "Juan Diego" <[hidden email]> wrote:
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: duplicate rtmp connection

Rajdeep Rath

An application adapter in my view is more like a hook than a application. It lets you hook into the lifecycle of a connection and stream through various handler methods.(stream and connection). In those handler you can catch a reference of connection / stream. But you wouldn't need to do that.

In eclipse if you ask the ide to render all overridden methods on the application adapter class, you will see the handlers ans much more...

Regards
Rajdeep Rath


On Aug 27, 2016 12:17 AM, "Rajdeep Rath" <[hidden email]> wrote:

Perhaps you can look at this :
https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/proxy/StreamingProxy.java

And examples relating to that are here and there so you need to google.

Red5 connections are of interface IConnection so i would start there

http://red5.org/javadoc/red5-server-common/org/red5/server/api/class-use/IConnection.html

And explore all base and inherited implemented classes to get a good grasp of its capabilities.

Regards
Rajdeep Rath


On Aug 27, 2016 12:06 AM, "Juan Diego" <[hidden email]> wrote:
Rajdeep, thanks that was really usefull.  The only thing that I dont understand is in my app how do I get the Stream, which class manages that information.  Sorry if what I am saying sounds stupid. Does ApplicationAdapter has a Stream  or does "IConnection conn" manages?  What type of object are rtmp connections on red5?

On Fri, Aug 26, 2016 at 1:13 PM, Rajdeep Rath <[hidden email]> wrote:
Well that depends on what you need to achieve. Whether purpose is streaming or just data transmission. Either ways the best think is to duplicate the data you are concerned with rather that thinking of the word session.

If say I want a connection called joe, I can create a connection from client to red5 and onAppConnect add a connection attribute name-> joe. Then if I want to replicate this I would use a rtmp client to make a connection to other servers, passing that attribute along as parameters. On other server on connection success I can again store the attribute on the connection.

In red5 as a example if you pass a query string the connection object can retrieve that in java code. So if you connect to another server from this sever using the same url then the query params should be available on that server as well.

When replicating streams it would be best to replicate the connection data and then publish same stream to other server by same name. If possible also copy over the stream metadata as well.(advance)

Similarly you can design a strategy for replicating realtime data changes across servers almost instantly.

These are just some thoughts ... ,May or  May not be helpful depending upon what you need.
 Haven't worked on all these myself so I cant give code examples. Finally I would just say even though it's connection oriented don't think of it as session always when replicating. If it's helpful do let me know.

Regards
Rajdeep Rath

On Friday, August 26, 2016, Juan Diego <[hidden email]> wrote:
Are you asking if I am trying to duplicate the connection or the streams?  What do you think is better?

On Fri, Aug 26, 2016 at 11:14 AM, Rajdeep Rath <[hidden email]> wrote:

Hey..

Sorry looking at this very late. Ut would be great if you can explain once more what you trying to get working.

After you trying to repeat connection or are you trying to repeat stream on other servers ?


On Aug 26, 2016 9:40 PM, "Juan Diego" <[hidden email]> wrote:
I created a cluster on Amazon with WildFly 10, red5 is running inside those Wildflies.  I am able to scale without problems, I am using S3Ping to discover my boxes on Amazon.  The only problem that I have is that if I connect to my load balancer from a  Broadcaster and I have 2 or more server I might end up connecting to the other servers where there is no scope created.  Which make senses, because RTMP is not handle in sessions like http.  I was expecting this problem, but  I was looking for ways to solve this, and I thought about using infinispan, JBoss/Wildfly already uses infinispan.  So I was thinking that when ever a connection is created from a broadcaster to one of those servers, I should store the content in Infinispan and recreate the scope in the other servers.  I was thinking that in my appConnect function I should send the content to Infinispan, but I have no Idea which class handles the content, is . 
Also if someone connects to rtmp://myloadbalancer/myApp/myscope,  myscope should be recreated in all the servers.  So when Infinispan detects a new item of type scope in its cache it should create a new scope with the content.  I ll probably have to kill the cache when ever a connection closes too.

I also see the problem if my broadcaster looses connectivity and the loadbalancer sends it to another server, the broadcast probably dies., but that is a problem I can leave for the future.  I will like to be able to connect from a subscriber to any node and be able to look at the stream created my broadcaster.

Thanks


On Wed, Aug 24, 2016 at 5:32 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
    The RTMP is connection oriented, when connection go away, the server is not able to recognize a client that's coming back.

    In the HTTP protocol you have the same situation. When connection drop, everything is lost. The applications solve it by using session ID's (cookies).

    So, short answer is: It's up to your application to handle the data and store/replicate it to anywhere. And it's up to your client to send something that allow server to recognize it.

    If you explain us what exactly you're trying to do and the kind of problem you're trying to solve, maybe we can help, but with this level of details, even trying, I can't find ways of

    Tiago


On 24/08/16 19:08, Juan Diego wrote:
Which class handles the content on rtmp connection, I want to send that content to Infinispan.
I want to understand a little bit more about process how is the rtmp handled?
How do I create an scope programatically.  Cause I want to duplicate an scope?
How does red5 know how long to keep a connection a live?

On Mon, Jul 25, 2016 at 4:51 PM, Juan Diego <[hidden email]> wrote:
Thanks a lot

On Mon, Jul 11, 2016 at 1:42 PM, Tiago Daniel Jacobs <[hidden email]> wrote:
Juan, what Paul is saying is totally correct.

Alternatively, if you need high availability (and cannot loose a single frame) you can duplicate the work in the publisher and subscriber.


It's a uncommon approach but we had one customer that did it (medical industry).

Basically they was publishing twice and consuming twice, to avoid having a single POF.


Best regards,
Tiago



On 11/07/16 14:39, Mondain wrote:
An RTMP connection contains a socket, which cannot be shared, it is transient and not serializable; thats the first item you want to understand. The content of a session which could be serialized is what you probably want to pass into Infinispan. The easiest way to do that is to pass whatever content you want to save into your application adapter (thats were you extend MultiThreadedAdapter with your own class) and then push it to Infinispan; you can do this on connect or by way of a custom method of your own.

Paul 

On Mon, Jul 11, 2016 at 1:30 PM Juan Diego <[hidden email]> wrote:
Hi,

I am working with infinispan to duplicate a session with rtmp on another server.  I was wondering if someone can give me some pointers as to where to start.
I have being looking at the code on red5-server, and oflademo.
I think this could be solve at Application level not necessarily at the Red5 server level.
What I was thinking is that in my app in the appConnect function I would send the Connection and the params to the cache on infinispank, I am not sure this will keep the connection.
I dont know if I would have to modify instead the MultiThreadedApplicationAdapter class in red5 server instead. Or maybe I am just talking nonsense.
Thanks
JD


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.