You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "suncairong163 (via GitHub)" <gi...@apache.org> on 2023/06/03 09:29:52 UTC
[GitHub] [dubbo] suncairong163 opened a new pull request, #12452: http protocol detector
suncairong163 opened a new pull request, #12452:
URL: https://github.com/apache/dubbo/pull/12452
## What is the purpose of the change
add http protocol detector for support http PortUnification
## Brief changelog
## Verifying this change
@AlbumenJ
<!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
- [ ] GitHub Actions works fine on your own branch.
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575481798
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [19 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [33.2% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] codecov-commenter commented on pull request #12452: http protocol detector
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575680017
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/12452?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> :exclamation: No coverage uploaded for pull request base (`3.3@30daba2`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit).
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## 3.3 #12452 +/- ##
======================================
Coverage ? 68.28%
Complexity ? 5
======================================
Files ? 1645
Lines ? 67739
Branches ? 9872
======================================
Hits ? 46255
Misses ? 17014
Partials ? 4470
```
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1574845831
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [54.1% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1579012386
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [36.1% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] suncairong163 commented on a diff in pull request #12452: http protocol detector
Posted by "suncairong163 (via GitHub)" <gi...@apache.org>.
suncairong163 commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217433426
##########
dubbo-common/src/main/java/org/apache/dubbo/common/utils/HttpUtils.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.common.utils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.GET;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.POST;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.DELETE;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.PUT;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.HEAD;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.PATCH;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.OPTIONS;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.TRACE;
+
+/**
+ * for http methods
+ */
+public class HttpUtils {
Review Comment:
ok , I will change the position
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] suncairong163 commented on a diff in pull request #12452: http protocol detector
Posted by "suncairong163 (via GitHub)" <gi...@apache.org>.
suncairong163 commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1218774898
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
+ return Result.UNRECOGNIZED;
+ }
+
+ default Result detect(ChannelBuffer in, URL url) {
Review Comment:
AbstractHttpProtocolDetector 这个抽象可以的有qos和http两个实现,ProtocolDetector 直接进行enable的set,因为QosWireProtocol 这个是单例的,不同url之间开关会不会有影响?增加url参数也是想动态的进行开关,还有就是如果用户想显式的关闭某种协议就不能单单通过export判断了
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] suncairong163 commented on a diff in pull request #12452: http protocol detector
Posted by "suncairong163 (via GitHub)" <gi...@apache.org>.
suncairong163 commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217642517
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
+ return Result.UNRECOGNIZED;
+ }
+
+ default Result detect(ChannelBuffer in, URL url) {
Review Comment:
1.AbstractHttpProtocolDetector 这个抽象可以的有qos和http两个实现,ProtocolDetector 直接进行enable的set,因为QosWireProtocol 这个是单例的,不同url之间开关会不会有影响?增加url参数也是想动态的进行开关,还有就是如果用户想显式的关闭某种协议就不能单单通过export判断了,
2.NettyPortUnificationServer 这个server实现上,只会保存第一个实例创建时的URL,而且后面的执行链路,相同端口使用的都是这个url,不同的service的上下文就丢掉了
3.目前的单端口多协议wireProtocol 是分开实现的,如果用户想实现所有协议支持,就需要引入dubboall 或者每个rpc protcol 都要引入进入
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] CrazyHZM commented on a diff in pull request #12452: http protocol detector
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217561204
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
+ return Result.UNRECOGNIZED;
+ }
+
+ default Result detect(ChannelBuffer in, URL url) {
Review Comment:
1. 我在想qos有关http的是不是还是需要依赖http的模块,这样才能保证所有http的实现都在一个地方,它的层级应该跟triple是一样的,应该在抽象的http之上,qos的命令应该只是rest服务接口中的一部分,但是qos命令受开关影响,举个例子,有一个AbstractHttpProtocolDetector。
2. 这个判断应该是有export的时候就应该把开关传递过来,就像QosEnableFlag,但我觉得这个开关的确可以被抽象在ProtocolDetector中。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575678622
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [21 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [34.6% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] CrazyHZM merged pull request #12452: http protocol detector
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM merged PR #12452:
URL: https://github.com/apache/dubbo/pull/12452
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] suncairong163 commented on a diff in pull request #12452: http protocol detector
Posted by "suncairong163 (via GitHub)" <gi...@apache.org>.
suncairong163 commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217642517
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
+ return Result.UNRECOGNIZED;
+ }
+
+ default Result detect(ChannelBuffer in, URL url) {
Review Comment:
1.AbstractHttpProtocolDetector 这个抽象可以的有qos和http两个实现,ProtocolDetector 直接进行enable的set,因为QosWireProtocol 这个是单例的,不同url之间开关会不会有影响?增加url参数也是想动态的进行开关,还有就是如果用户想显式的关闭某种协议就不能单单通过export判断了,
2.NettyPortUnificationServer 这个server实现上,只会保存第一个实例创建时的URL,而且后面的执行链路,相同端口使用的都是这个url,不同的service的上下文就丢掉了
3.目前的单端口多协议wireProtocol 是分开实现的,如果用户想实现所有协议支持,就需要引入dubboall 或者每个rpc protcol 都要引入进入
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ commented on pull request #12452: http protocol detector
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575940742
@EarthChen @CrazyHZM PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] CrazyHZM commented on a diff in pull request #12452: http protocol detector
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217401904
##########
dubbo-common/src/main/java/org/apache/dubbo/common/utils/HttpUtils.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.common.utils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.GET;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.POST;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.DELETE;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.PUT;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.HEAD;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.PATCH;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.OPTIONS;
+import static org.apache.dubbo.common.utils.HttpUtils.HttpMethod.TRACE;
+
+/**
+ * for http methods
+ */
+public class HttpUtils {
Review Comment:
This class is not suitable for the dubco-common module in terms of function and methods. There is no current intersection between qos and http handling except HttpMethod, and the methods in HttpUtils are not suitable for all modules.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1581117826
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [42.9% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] suncairong163 commented on pull request #12452: http protocol detector
Posted by "suncairong163 (via GitHub)" <gi...@apache.org>.
suncairong163 commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575571628
@chickenlj rest protocol is integrated into PortUnification
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575588289
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [19 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [32.1% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] CrazyHZM commented on a diff in pull request #12452: http protocol detector
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217434407
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
+ return Result.UNRECOGNIZED;
+ }
+
+ default Result detect(ChannelBuffer in, URL url) {
Review Comment:
I don't see a use for url, and it shouldn't be in this interface definition.
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
Review Comment:
There is no need to change this to `default`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12452: http protocol detector
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#issuecomment-1575523956
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12452)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12452&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL) [19 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12452&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list) [33.2% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12452&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] suncairong163 commented on a diff in pull request #12452: http protocol detector
Posted by "suncairong163 (via GitHub)" <gi...@apache.org>.
suncairong163 commented on code in PR #12452:
URL: https://github.com/apache/dubbo/pull/12452#discussion_r1217470903
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/ProtocolDetector.java:
##########
@@ -17,18 +17,90 @@
package org.apache.dubbo.remoting.api;
+import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
/**
* Determine incoming bytes belong to the specific protocol.
- *
*/
public interface ProtocolDetector {
+ int empty = ' ';
+
+ default Result detect(ChannelBuffer in) {
+ return Result.UNRECOGNIZED;
+ }
+
+ default Result detect(ChannelBuffer in, URL url) {
Review Comment:
1.qos和rest 在http检测这块是有冲突的, 当Qos 和rest同时开启时, 需要进行 requestUrl 判断 , service经过 RestProtocol 进行export时才认为 rest开启,不能通过RestProtocol的存在与否判断,这个rest开启标志通过url进行传递
2.希望detector添加 开关,通过url属性进行判断
所以就增加了这个参数
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org