Netty 로 만든 어플리케이션에서 서버쪽에 에러가 발생하였다.

 

adjusted frame length exceeds 1048576

 

아.. 이것은 무엇인고.. 

 

Netty 에서 메시지  기본 용량은 1048576이다.  단위는  Byte 이다.

 

즉 서버와 클라이언트 통신간에 메시지 용량이 초가해서 들어온것.

@Override
public void initChannel(SocketChannel ch) throws Exception {

	ChannelPipeline pipeline = ch.pipeline();

	// Add SSL handler first to encrypt and decrypt everything.
	// In this example, we use a bogus certificate in the server side
	// and accept any invalid certificates in the client side.
	// You will need something more complicated to identify both
	// and server in the real world.
	if (sslCtx != null) {
		pipeline.addLast(sslCtx.newHandler(ch.alloc()));
	}

	// On top of the SSL handler, add the text line codec.
	pipeline.addLast(
		new ObjectEncoder(),
		//new ObjectDecoder(ClassResolvers.cacheDisabled(null)),
		new ObjectDecoder(2097152, ClassResolvers.cacheDisabled(null)),
		new ObjectEchoServerHandler());
}

 

addLast 메소드에서 

new ObjectDecoder(ClassResolvers.cacheDisabled(null)) => new ObjectDecoder(2097152, ClassResolvers.cacheDisabled(null)),

로 변경하여 해결하였다.

 


 

'개발경험 및 메모 > Netty' 카테고리의 다른 글

Netty - handshake timed out 에러 (2)  (0) 2020.07.03
Netty - handshake timed out 에러 (1)  (0) 2020.06.23
Netty 로깅 핸들러  (0) 2020.06.20
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기