Client to Handle Conversation, Presence and Heartbeats

Charles Hudak meadandale at gmail.com
Mon Sep 12 17:58:17 EDT 2011


A heartbeat message is used when you have an idle channel and you want both
ends to know that the other is still there so they don't disconnect. If your
channel is actively sending messages there is no point in having a heart
beat. IOW, it doesn't make sense to interleave the sending of messages with
heartbeats unless you expect a lengthy gap between the sending of messages.
However, that is not what you indicated in your original message.

I think you need to ignore Netty and figure out more clearly what your
messaging protocol is. When you understand that correctly without Netty then
you can figure out how to implement it in Netty. Otherwise you are putting
the cart before the horse. Netty is just a tool it is not a magic bean.

On Mon, Sep 12, 2011 at 2:44 PM, Replicator <webakaunt at gmail.com> wrote:

> Right, so given the protocol, I just described, some messages are
> heartbeats, some presence, some raw data => all coming through the same
> socket / port, what is the way to model this in Netty?
>
> Is that a single Netty client with 2 different handlers ( upstream,
> downstream ) that solve for all these different messages? Is it a single
> Netty client with multiple handlers per [UP/DOWN] stream, each responsible
> for different things, e.g. heartbeat, presence, consuming messages? Is it
> something else?
>
> Thank you.
>
>
> On Mon, Sep 12, 2011 at 4:52 PM, chudak [via Netty Forums and Mailing
> Lists]
> <ml-node+s685743n6785214h33 at n2.nabble.com> wrote:
>
> > IMO you only have one communication stream. You just have to decide on
> the
> > what the messaging protocol is between your client and server and the
> > implement that in Netty.
> >
> > On Mon, Sep 12, 2011 at 11:52 AM, Replicator <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=6785214&i=0>
> > > wrote:
> >
> >> @chudak,
> >>
> >>    I am new to Netty, just trying to get my head around how to model
> these
> >> communication pattern. Is that a single Netty client with 2 different
> >> handlers ( upstream, downstream )? Is it a single Netty client with
> >> multiple
> >> handlers per [UP/DOWN] stream, each responsible for different things,
> e.g.
> >> heartbeat, presence, consuming messages?
> >>
> >> Thank you!
> >>
> >> On Mon, Sep 12, 2011 at 2:44 PM, chudak [via Netty Forums and Mailing
> >> Lists]
> >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=6785214&i=1>>
> >> wrote:
> >>
> >> > The sending of the messages by the server to the client is the
> >> heartbeat.
> >> > Not sure why you think you'd need a separate heartbeat (channel).
> >> >
> >> > On Mon, Sep 12, 2011 at 11:40 AM, Replicator <[hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=6784814&i=0>
> >>
> >> > > wrote:
> >> >
> >> >> We need to have a client that is consuming messages from from the
> >> server (
> >> >> that we don't control ), and occasionally send messages to the
> server.
> >> For
> >> >> example:
> >> >>
> >> >>     1. client sends "I am up" message to the server
> >> >>     2. server sends "I know that you are up. Starting to send you
> >> stuff"
> >> >> message back to the client
> >> >>     3. server sends massive number of messages to the client
> >> >>     4. meanwhile client and server send each other heartbeats ( on
> the
> >> >> same
> >> >> port ) every second.
> >> >>
> >> >> Which messaging pattern can we use for this client? Or is it just as
> >> >> simple
> >> >> as having a client with registered upstream and downstream handlers
> >> that
> >> >> handle heartbeats, presence, etc.. messages?
> >> >>
> >> >> Thank you!
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Client-to-Handle-Conversation-Presence-and-Heartbeats-tp6784800p6784800.html
> >> >> Sent from the Netty User Group mailing list archive at Nabble.com.
> >> >> _______________________________________________
> >> >> netty-users mailing list
> >> >> [hidden email] <http://user/SendEmail.jtp?type=node&node=6784814&i=1
> >
> >>
> >> >> https://lists.jboss.org/mailman/listinfo/netty-users
> >> >>
> >> >
> >> >
> >> > _______________________________________________
> >> > netty-users mailing list
> >> > [hidden email] <http://user/SendEmail.jtp?type=node&node=6784814&i=2>
> >>
> >> > https://lists.jboss.org/mailman/listinfo/netty-users
> >> >
> >> > ------------------------------
> >> >  If you reply to this email, your message will be added to the
> >> discussion
> >> > below:
> >> >
> >> >
> >>
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Client-to-Handle-Conversation-Presence-and-Heartbeats-tp6784800p6784814.html
> >> >  To unsubscribe from Client to Handle Conversation, Presence and
> >> > Heartbeats, click here<
> >> >
> >> >
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Client-to-Handle-Conversation-Presence-and-Heartbeats-tp6784800p6784845.html
> >> Sent from the Netty User Group mailing list archive at Nabble.com.
> >> _______________________________________________
> >> netty-users mailing list
> >> [hidden email] <http://user/SendEmail.jtp?type=node&node=6785214&i=2>
> >> https://lists.jboss.org/mailman/listinfo/netty-users
> >>
> >
> >
> > _______________________________________________
> > netty-users mailing list
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=6785214&i=3>
> > https://lists.jboss.org/mailman/listinfo/netty-users
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Client-to-Handle-Conversation-Presence-and-Heartbeats-tp6784800p6785214.html
> >  To unsubscribe from Client to Handle Conversation, Presence and
> > Heartbeats, click here<
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6784800&code=d2ViYWthdW50QGdtYWlsLmNvbXw2Nzg0ODAwfC0xODA0ODQ0MTcz
> >.
> >
> >
>
>
> --
> View this message in context:
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Client-to-Handle-Conversation-Presence-and-Heartbeats-tp6784800p6785383.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110912/d3638a40/attachment.html 


More information about the netty-users mailing list