how to pass unique value with message

Johnny Luong johnny.luong at trustcommerce.com
Thu Jul 15 17:00:55 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

anthony_w wrote:
| I have a problem I can't seem to figure out how to solve.  I can't tell if
| the answer is staring me in the face and I'm just not seeing it.
|
| I have a server app with handlers in the pipeline like this.
|
| H[A] -> H[B] -> H[C] -> H[D]
|
| I need to calculate the elapsed time from A to D on a per-message basis.
| I'm ok with storing the starting time in a map somewhere when I'm in
handler
| A.  Is there a way to uniquely identify each message within Netty so
that I
| could retrieve the starting time when I get to handler D?  Having the
client
| include a unique value in the message is not an option.  Thanks.
|
| anthony

If you have some way of relating D to C, C to B, B to A, then you can
find the elapse time upon completion of handler D with your starting
time in a map for handler A by walking through the relationship.  In my
application, I do a variation on that internally by passing along my
POJO from handler A, a starting timestamp which negates the need for a
separate Map.  In other words, I'm simply manipulating the same object
just from different interfaces.

Best,
Johnny
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkw/dwcACgkQg7TIS7A9isd6KQCgzCSl3ShGfBs2HrbAePbIrmFj
6u0Anie6EC7n+rZpA7X0TTLYdtRwoI4O
=e3oG
-----END PGP SIGNATURE-----


More information about the netty-users mailing list