Client to Handle Conversation, Presence and Heartbeats
Johnny Luong
johnny.luong at trustcommerce.com
Mon Sep 12 21:48:49 EDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 09/12/2011 11:40 AM, Replicator 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
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
>
You can use handlers for pretty much all of that. The examples cover
upstream and downstream handlers; you might also look at
SimpleChannelHandler if you are interested in a specific event. For
heartbeats, the IdleStateAwareChannelHandler is a useful class to work with.
- -Johnny
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with CentOS - http://enigmail.mozdev.org/
iQIcBAEBCAAGBQJObraBAAoJENQfv1FjsMMv//kP/AkhgtqysmiaahWSTpeW5v/u
0xYgxwkaFGnig69DyQnwoBUy45BJWT2bZSJNCVgrCUESdHMh6UDOUyYbfHRyEVaC
GkamJpJf9CbV/SWm1JiuhiPz+9R39kw1/Q9UNvqYumtR4XGZOEWXgjpCm/QgvzI4
l9A5lmJVVrS0vOz/gHjJVkUnX39LJyc3s4Iew8j68fYTBQ9RWTuJh64BalnghDLG
Q0I3S9guN9FCgBRjYfOh6hBCMrGugMhLz90Ia48R5uYGFi1gM/sZNJcDKNmUZIe7
sn5Xt2dxqSVKSirL6AZkHEPfd2SG2STNF4Ao/6HfE2bf2Yf9EDC1HVfzMiTH7fI6
OJ1syIQCcmyurOwJNv4fV7ll6EdIjxcdC0QOhYkAYK9r3quPc7nHokA7oP3zshAa
RtXx4CsS4jgoB/XgYM9UnuZ4G/Mu49pYvLMJlBpdAgNunRkNLU9dcX/Pi7PzLVei
IhcwErlF5c6lp0Is8OgqP+pL5CGyWdVhVGjfLF0/GtSKEDhNzk3xJLhsD/vuNd23
/qrBBUl6owLOgwZ+InRvedv2//6GJKid/yfDVGjYK1hiRh0b+5MqYdhTu8tUso3b
2Uxu6N4bTGXrPdd948UdWyjYWouNacpvUMFSUODh/L7hpKWT8JFLA+WSC/zfltl9
MQPxnyDWTMiHp10jLa+I
=OQi3
-----END PGP SIGNATURE-----
More information about the netty-users
mailing list