TCP Client using correlation ID

Bruno de Carvalho kindernade at gmail.com
Thu May 12 09:27:45 EDT 2011


Howdy,


http://d.pr/tso8

While this tutorial doesn't have message ID, it covers the introduction of a message envelope - which is something you'd use to have a request/response transaction id.

Basically, you'd add an extra field in the message envelope (say an integer, thought I'd prefer a 32 byte hash - e.g. "hash(clientId:messageSequenceNumber:salt)") to that tutorial's code and then code your client handler to deal with out-of-order message reception.


HTH,
  Bruno


On May 12, 2011, at 12:54 PM, bigvision wrote:

> Hi all,
> 
> I am working on designing a TCP client that will send multiple requests to a
> server and then receive responses in an arbitrary order. The client needs to
> match the response to the request based on a correlation/transaction id that
> is part of the payload. 
> 
> Netty seems like a good solution, and I have been looking at some good
> examples. But all the examples I have seen seem to be assuming that
> responses are received in the same order as the requests that were sent.
> 
> Does anyone have a suggestion for this design, or even better, a code
> example?
> 
> Thanks very much.
> David
> 
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/TCP-Client-using-correlation-ID-tp6355486p6355486.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




More information about the netty-users mailing list