Fix Spring injection for Netty clients

pull/365/head
lucky 8 2 years ago
parent d35f7d976a
commit 5f5eb62bdd

@ -43,7 +43,6 @@ import org.springframework.stereotype.Component;
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@Component
public class NettyConnectSender implements MessageSender { public class NettyConnectSender implements MessageSender {
private ServerNettyAgent serverNettyAgent; private ServerNettyAgent serverNettyAgent;
@ -59,7 +58,7 @@ public class NettyConnectSender implements MessageSender {
.handler(new ChannelInitializer<SocketChannel>() { .handler(new ChannelInitializer<SocketChannel>() {
@Override @Override
protected void initChannel(SocketChannel ch) throws Exception { protected void initChannel(SocketChannel ch) {
ChannelPipeline pipeline = ch.pipeline(); ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(new ObjectEncoder()); pipeline.addLast(new ObjectEncoder());
pipeline.addLast(new ObjectDecoder(Integer.MAX_VALUE, pipeline.addLast(new ObjectDecoder(Integer.MAX_VALUE,
@ -71,8 +70,6 @@ public class NettyConnectSender implements MessageSender {
bootstrap.connect(serverNettyAgent.getNettyServerAddress(), serverNettyAgent.getNettyServerPort()).sync(); bootstrap.connect(serverNettyAgent.getNettyServerAddress(), serverNettyAgent.getNettyServerPort()).sync();
} catch (Exception e) { } catch (Exception e) {
log.error("netty send error ", e); log.error("netty send error ", e);
} /* }
* finally { eventLoopGroup.shutdownGracefully(); }
*/
} }
} }

Loading…
Cancel
Save