users@grizzly.java.net

Grizzly TCP Server: how to async call inside a filter

From: Raffaele Marcello <marcelloraffaele_at_gmail.com>
Date: Tue, 22 Oct 2013 16:10:37 +0200

Hi,
i developed a TCP Server using Grizzly using two Filters:
 - MyProtocolFilter to manage the protocol( messages recognition )
 - MyCallerFilter to invoke a remote server (using RMI) and manage the
answer.

Unfortunately now it works using only one thread per connection. I'm having
problems because sometimes some message can arrive while i'm waiting for
the remote method invocation. In that case the new message is queued in
input buffer and it can cause retransmissions.
I want to ask if is possible to asynchronous invoke remote methods managing
the results(Maybe using another thread). In this way i could manage new
arriving messages while i'm waiting responses.
Does anyone have a solution in order to maintain good performance? Can i
use some Grizzly configuration or specific class?


Thanks
R