camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bulutoprak <bulutop...@hotmail.com>
Subject Camel netty response is trimied for large data
Date Mon, 17 Feb 2014 08:35:33 GMT
Hi, 
I am using netty tcp route to handle requests and return a string message to
the clients. The solution is working for most of the case, but recently we
noticed that if the returned string is a large string (>2milyon characters)
, client socket can read only part of it. On the client, the code is like
this


// Client socket (pure java client socket getting response part
// First part is header part which identifies the length of the remaining
data. 
numread = currentInput.read(headerBuff, 0,10);

// We get the msgLenvariable from the header

	readBuff = new char[msgLen];
	readIndex = 0;
	while (readIndex < msgLen) {
*                // First read operation reads 262780 characters always and
second read blocks the socket.*
		numread = currentInput.read(readBuff, readIndex, msgLen - readIndex);
		readIndex += numread;
	}
	msgStr = new String(readBuff, 0, readIndex);




//Server side  uses StringEncoder to add the header part 

protected Object encode(ChannelHandlerContext ctx, Channel channel, Object
msg) throws Exception {

String dataToSend= ....  //We get the data by appending the header 
return ChannelBuffers.copiedBuffer(dataToSend,charset);
}

Route url:
netty:tcp://0.0.0.0:17710?workerCount=100&corePoolSize=100&maxPoolSize=200&decoder=#inStringDecoder&encoder=#inStringEncoder&allowDefaultCodec=false&sync=true



My question is , is there mechanism that limits the number of
characters/bytes to return to the client in netty. 






--
View this message in context: http://camel.465427.n5.nabble.com/Camel-netty-response-is-trimied-for-large-data-tp5747417.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message