config.getSessionConfig().setTcpNoDelay(true); this is what I have for the connector but I am sure acceptor will have the same sort of setting.
On Tue, Nov 3, 2009 at 9:37 PM, Erinc Arikan <erincari...@gmail.com> wrote: > Hi everybody; > > I implemented a byte based TCP protocol, To accomplish that I implemented my > own protocolcodecfilter to decode byte stream into POJO's. My Protocol > requires me to send an ACK/NAK whenever I receive a complete, meaningful > message. I thought that I could write ACK directly to session in my decoder > right after I am done with decoding but I couldn't make it work. > > So instead of doing that, I pass my POJO's to my custom message handler > where all my business logic lies. And before processing POJO, first thing I > do is writing the ACK back to session using session.write method. And I > start processing the message after that. But it looks like my ACKs never get > to the client right away, most of the time they wait for the response of > actual message , and will be delivered to client together(they only have 200 > ms difference). > > This is a huge problem for me because there's no point in having the ACK > when you experience this issue. By the time they have the ACK, they will get > the response anyway. > > I am wondering if there's a way to guarantee transmission of the ACK in a > non blocking manner, without waiting for the actual message response. Mostly > I am processing credit card authorizations which is a synchronous process > and can take up to 4-5 seconds. I add them to ACTIVEMQ, payment processor > picks them up. Definitely I want to be able to send the ack right away > without waiting for 5 seconds. > > Any thoughts on how to do that? >