Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
import org.apache.dubbo.rpc.model.FrameworkModel;
import org.apache.dubbo.rpc.model.ScopeModelAware;

import io.netty.channel.ChannelPipeline;
import io.netty.handler.ssl.SslContext;

import java.util.ArrayList;
import java.util.List;

Expand All @@ -54,10 +51,4 @@ public void configServerProtocolHandler(URL url, ChannelOperator operator) {
operator.configChannelHandler(handlers);
}


@Override
public void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext sslContext) {

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package org.apache.dubbo.remoting.api;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.api.pu.ChannelOperator;

import io.netty.channel.ChannelPipeline;
import io.netty.handler.ssl.SslContext;

public abstract class AbstractWireProtocol implements WireProtocol {
Expand All @@ -35,7 +35,7 @@ public ProtocolDetector detector() {
}

@Override
public void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext sslContext) {
public void configClientPipeline(URL url, ChannelOperator operator, SslContext sslContext) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.dubbo.common.extension.SPI;
import org.apache.dubbo.remoting.api.pu.ChannelOperator;

import io.netty.channel.ChannelPipeline;
import io.netty.handler.ssl.SslContext;

@SPI(scope = ExtensionScope.FRAMEWORK)
Expand All @@ -31,7 +30,7 @@ public interface WireProtocol {

void configServerProtocolHandler(URL url, ChannelOperator operator);

void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext sslContext);
void configClientPipeline(URL url, ChannelOperator operator, SslContext sslContext);

void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.api.pu.ChannelOperator;

import io.netty.channel.ChannelPipeline;
import io.netty.handler.ssl.SslContext;

public class EmptyProtocol implements WireProtocol {
Expand All @@ -34,7 +33,7 @@ public void configServerProtocolHandler(URL url, ChannelOperator operator) {
}

@Override
public void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext sslContext) {
public void configClientPipeline(URL url, ChannelOperator operator, SslContext sslContext) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ private void initBootstrap() {
nettyBootstrap.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) {
NettyChannel nettyChannel = NettyChannel.getOrAddChannel(ch, getUrl(), getChannelHandler());
final ChannelPipeline pipeline = ch.pipeline();
SslContext sslContext = null;
if (getUrl().getParameter(SSL_ENABLED_KEY, false)) {
Expand All @@ -120,7 +121,9 @@ protected void initChannel(SocketChannel ch) {
// TODO support IDLE
// int heartbeatInterval = UrlUtils.getHeartbeat(getUrl());
pipeline.addLast("connectionHandler", connectionHandler);
protocol.configClientPipeline(getUrl(), pipeline, sslContext);

NettyConfigOperator operator = new NettyConfigOperator(nettyChannel, getChannelHandler());
protocol.configClientPipeline(getUrl(), operator, sslContext);
// TODO support Socks5
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void configServerProtocolHandler(URL url, ChannelOperator operator) {
}

@Override
public void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext sslContext) {
public void configClientPipeline(URL url, ChannelOperator operator, SslContext sslContext) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private Executor lookupExecutor(URL url) {
}

@Override
public void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext sslContext) {
public void configClientPipeline(URL url, ChannelOperator operator, SslContext sslContext) {
final Http2FrameCodec codec = Http2FrameCodecBuilder.forClient()
.gracefulShutdownTimeoutMillis(10000)
.initialSettings(new Http2Settings().headerTableSize(
Expand All @@ -175,6 +175,10 @@ public void configClientPipeline(URL url, ChannelPipeline pipeline, SslContext s
.build();
final Http2MultiplexHandler handler = new Http2MultiplexHandler(
new TripleClientHandler(frameworkModel));
pipeline.addLast(codec, handler, new TripleTailHandler());
List<ChannelHandler> handlers = new ArrayList<>();
handlers.add(new ChannelHandlerPretender(codec));
handlers.add(new ChannelHandlerPretender(handler));
handlers.add(new ChannelHandlerPretender(new TripleTailHandler()));
operator.configChannelHandler(handlers);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.common.threadpool.manager.ExecutorRepository;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.remoting.ChannelHandler;
import org.apache.dubbo.remoting.RemotingException;
import org.apache.dubbo.remoting.api.connection.AbstractConnectionClient;
import org.apache.dubbo.remoting.api.connection.ConnectionManager;
import org.apache.dubbo.remoting.api.connection.SingleProtocolConnectionManager;
import org.apache.dubbo.remoting.api.pu.DefaultPuHandler;
import org.apache.dubbo.remoting.exchange.PortUnificationExchanger;
import org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationServer;
import org.apache.dubbo.rpc.RpcInvocation;
import org.apache.dubbo.rpc.model.MethodDescriptor;
import org.apache.dubbo.rpc.model.ReflectionMethodDescriptor;
Expand All @@ -38,12 +32,10 @@

import io.netty.channel.Channel;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.util.HashSet;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;

import static org.mockito.ArgumentMatchers.any;
Expand Down