-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: seata-server support http protocol #6801
base: 2.x
Are you sure you want to change the base?
Conversation
2. support multi-version
…GrpcMessageProto.java
…SeataServiceGrpc.java
…seata/serializer/protobuf/GrpcSerializer.java
…GrpcMessageProtoOrBuilder.java
# Conflicts: # core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java
core/src/main/java/org/apache/seata/core/rpc/netty/http/HttpDispatchHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/seata/core/rpc/netty/http/ParameterParser.java
Outdated
Show resolved
Hide resolved
@Override | ||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { | ||
if (msg instanceof Http2HeadersFrame) { | ||
if (headerSent.compareAndSet(false, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个连接如果一直被复用,但是没有开启双向流的形式,使用http2传递不同的header,但是这里只读了一次,会不会有问题?
If this connection has been reused all the time, but the form of bidirectional streaming is not enabled, using HTTP2 to pass different headers, but only read it once, will there be a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unary模式的话,每次都会开启一条新的流,channel和handler都会创建新的
core/src/main/java/org/apache/seata/core/rpc/netty/http2/Http2DispatchHandler.java
Outdated
Show resolved
Hide resolved
...a-serializer-protobuf/src/main/java/org/apache/seata/serializer/protobuf/GrpcSerializer.java
Outdated
Show resolved
Hide resolved
@@ -86,6 +91,16 @@ public void onChangeEvent(ClusterChangeEvent event) { | |||
} | |||
|
|||
private void notify(Watcher<?> watcher) { | |||
Channel channel = (Channel) watcher.getAsyncContext(); | |||
if (channel instanceof Http2StreamChannel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http1的呢?如果通过8091端口进来的v1/watch,可不是下面的HttpServletResponse逻辑能正常执行的
What about HTTP1? If v1/watch comes in through port 8091, the following HttpServletResponse logic can not be executed normally
server/src/main/java/org/apache/seata/server/controller/ClusterController.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/seata/server/controller/ClusterController.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/apache/seata/common/DefaultValues.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/apache/seata/common/util/Http2ClientUtil.java
Outdated
Show resolved
Hide resolved
@@ -55,7 +56,7 @@ | |||
/** | |||
*/ | |||
@RestController | |||
@RequestMapping("/metadata/v1") | |||
@RequestMapping("/metadata") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么去除这里的v1,而在下面给每一个增加v1?
server/src/main/java/org/apache/seata/server/controller/ClusterController.java
Outdated
Show resolved
Hide resolved
...ery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
Outdated
Show resolved
Hide resolved
...ery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
Outdated
Show resolved
Hide resolved
...ery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
Outdated
Show resolved
Hide resolved
...ery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
Show resolved
Hide resolved
...ery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
Outdated
Show resolved
Hide resolved
…to http_support � Conflicts: � discovery/seata-discovery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增的配置项需要在https://github.com/apache/incubator-seata/tree/2.x/script/client 中的spring和file中添加示例
/** | ||
* http1 or http2 | ||
*/ | ||
String HTTP_VERSION = TRANSPORT_PREFIX + "httpVersion"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该放到registry.raft下面,而不是transport
Ⅰ. Describe what this PR did
support http protocol
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews