Client to Handle Conversation, Presence and Heartbeats
Replicator
webakaunt at gmail.com
Mon Sep 12 18:07:55 EDT 2011
A heartbeat message needs to be sent (and received) every 3 seconds
throughout the day.
I have a clear protocol (including a wire one) in front of me, which
includes:
client sends "I am here"
server responds "Ok" ( and starts sending messages )
client keeps consuming those messages throughout the day
both client and server send each other heartbeats throughout the day
The cart is actually behind the horse, but I need to understand how to mount
it to the horse correctly (using Netty), so you know, when the horse moves
forward, the card does not move sideways.
Again, I am new to Netty, but I am far from new to many other frameworks. I
just need a guidance around these Handlers, Pipes, MessageEvents, Bind
options, etc.. Hence my questions stands: given the above protocol, knowing
that it all has to happen over the same socket / port, how do I model it
with Netty?
Thank you.
On Mon, Sep 12, 2011 at 5:59 PM, chudak [via Netty Forums and Mailing Lists]
<ml-node+s685743n6785422h81 at n2.nabble.com> wrote:
> 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 <[hidden email]<http://user/SendEmail.jtp?type=node&node=6785422&i=0>
> > 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]
>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=6785422&i=1>>
>> 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<
>> >
>> >
>>
>>
>> --
>> 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
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=6785422&i=2>
>> https://lists.jboss.org/mailman/listinfo/netty-users
>>
>
>
> _______________________________________________
> netty-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=6785422&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-tp6784800p6785422.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-tp6784800p6785449.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list