Skip to content

Commit

Permalink
Merge branch 'apache-3.2' into apache-3.3
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	dubbo-common/pom.xml
#	dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java
#	dubbo-demo/dubbo-demo-triple/pom.xml
#	dubbo-dependencies-bom/pom.xml
#	dubbo-distribution/dubbo-all/pom.xml
#	dubbo-metadata/dubbo-metadata-processor/pom.xml
#	dubbo-native-plugin/pom.xml
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
#	dubbo-spring-boot/pom.xml
  • Loading branch information
AlbumenJ committed Dec 27, 2023
2 parents 2a0755c + 745ba45 commit d018475
Show file tree
Hide file tree
Showing 79 changed files with 1,510 additions and 728 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug Report
about: Report a bug in Dubbo
title: ''
labels: type/bug
labels: status/need-triage
assignees: ''

---
Expand Down
1 change: 0 additions & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ header:
- '**/*.fc'
- '**/*.javascript'
- '**/*.properties'
- '**/*.thrift'
- '**/*.sh'
- '**/*.bat'
- '**/*.md'
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,51 @@ See [CONTRIBUTING](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md)
* Twitter: [@ApacheDubbo](https://twitter.com/ApacheDubbo)
* Security issues: please mail to [us](mailto:[email protected]) privately.

## Contributing

See [CONTRIBUTING](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md) for details on submitting patches and the contribution workflow.

### How can I contribute?

* Take a look at issues with tags marked [`Good first issue`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or [`Help wanted`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
* Join the discussion on the mailing list, subscription [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide).
* Answer questions on [issues](https://github.com/apache/dubbo/issues).
* Fix bugs reported on [issues](https://github.com/apache/dubbo/issues), and send us a pull request.
* Review the existing [pull request](https://github.com/apache/dubbo/pulls).
* Improve the [website](https://github.com/apache/dubbo-website), typically we need
* blog post
* translation on documentation
* use cases around the integration of Dubbo in enterprise systems.
* Improve the [dubbo-admin/dubbo-monitor](https://github.com/apache/dubbo-admin).
* Contribute to the projects listed in [ecosystem](https://github.com/dubbo).
* Other forms of contribution not explicitly enumerated above.
* If you would like to contribute, please send an email to [email protected] to let us know!

## Reporting bugs

Please follow the [template](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md) for reporting any issues.

## Reporting a security vulnerability

Please report security vulnerabilities to [us](mailto:[email protected]) privately.

## Dubbo ecosystem

* [Dubbo Ecosystem Entry](https://github.com/apache?utf8=%E2%9C%93&q=dubbo&type=&language=) - A GitHub group `dubbo` to gather all Dubbo relevant projects not appropriate in [apache](https://github.com/apache) group yet
* [Dubbo Website](https://github.com/apache/dubbo-website) - Apache Dubbo official website
* [Dubbo Samples](https://github.com/apache/dubbo-samples) - samples for Apache Dubbo
* [Dubbo Spring Boot](https://github.com/apache/dubbo-spring-boot-project) - Spring Boot Project for Dubbo
* [Dubbo Admin](https://github.com/apache/dubbo-admin) - The reference implementation for Dubbo admin
* [Dubbo Awesome](https://github.com/apache/dubbo-awesome) - Dubbo's slides and video links in Meetup

#### Language

* [Go](https://github.com/apache/dubbo-go) (recommended)
* [Rust](https://github.com/apache/dubbo-rust)
* [Node.js](https://github.com/apache/dubbo-js)
* [Python](https://github.com/dubbo/py-client-for-apache-dubbo)
* [PHP](https://github.com/apache/dubbo-php-framework)
* [Erlang](https://github.com/apache/dubbo-erlang)

## License
Apache Dubbo is licensed under the Apache License Version 2.0. See the [LICENSE](https://github.com/apache/dubbo/blob/master/LICENSE) file for details.
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ ignore:
- "**/dubbo-native/**"
- "**/dubbo-common/src/main/java/org/apache/dubbo/common/json/*.java" # internal JSON impl is deprecate, ignore test coverage for them
- "**/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/AnnotationBean.java" # Deprecated
- "**/dubbo-rpc/dubbo-rpc-thrift/**"
5 changes: 5 additions & 0 deletions dubbo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,10 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* <ul>
* <li>{@link org.apache.dubbo.common.config.configcenter.file.FileSystemDynamicConfiguration "file"}</li>
* <li>{@link org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfiguration "zookeeper"}</li>
* <li>{@link org.apache.dubbo.configcenter.consul.ConsulDynamicConfiguration "consul"}</li>
* </ul>
*
* @see DynamicConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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 org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;

import static org.apache.dubbo.common.constants.CommonConstants.PROTOBUF_MESSAGE_CLASS_NAME;

public class ProtobufUtils {

private static final Logger logger = LoggerFactory.getLogger(ProtobufUtils.class);

private static Class<?> protobufClss;

private ProtobufUtils() {}

static {
try {
protobufClss = ClassUtils.forName(PROTOBUF_MESSAGE_CLASS_NAME, ProtobufUtils.class.getClassLoader());
} catch (Throwable t) {
logger.info("protobuf's dependency is absent");
}
}

public static boolean isProtobufClass(Class<?> pojoClazz) {
if (protobufClss != null) {
return protobufClss.isAssignableFrom(pojoClazz);
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ public abstract class AbstractServiceConfig extends AbstractInterfaceConfig {
*/
private Integer payload;

/**
* Whether to use java_package in IDL as path. Default use package.
* This param only available when service using native stub.
*/
private Boolean useJavaPackageAsPath;

public AbstractServiceConfig() {}

public AbstractServiceConfig(ModuleModel moduleModel) {
Expand All @@ -168,7 +174,9 @@ protected void checkDefault() {
if (dynamic == null) {
dynamic = true;
}

if (useJavaPackageAsPath == null) {
useJavaPackageAsPath = false;
}
if (StringUtils.isBlank(preferSerialization)) {
preferSerialization = serialization;
}
Expand Down Expand Up @@ -386,4 +394,13 @@ public Integer getPayload() {
public void setPayload(Integer payload) {
this.payload = payload;
}

public Boolean getUseJavaPackageAsPath() {
return useJavaPackageAsPath;
}

@Parameter(excluded = true)
public void setUseJavaPackageAsPath(Boolean useJavaPackageAsPath) {
this.useJavaPackageAsPath = useJavaPackageAsPath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,17 @@
String[] listener() default {};

/**
* Customized parameter key-value pair, for example: {key1, value1, key2, value2}
* Customized parameter key-value pair, for example:
* <pre>
* ["a","b"] ==> {a=b}
* [" a "," b "] ==> {a=b}
* ["a=b"] ==>{a=b}
* ["a:b"] ==>{a=b}
* ["a=b","c","d"] ==>{a=b,c=d}
* ["a","a:b"] ==>{a="a:b"}
* ["a","a,b"] ==>{a="a,b"}
* </pre>
* @see org.apache.dubbo.config.spring.util.DubboAnnotationUtils#convertParameters(java.lang.String[])
*/
String[] parameters() default {};

Expand Down Expand Up @@ -327,4 +337,21 @@
* Payload max length.
*/
String payload() default "";

/**
* The serialization type
*/
String serialization() default "";

/**
* If the parameter has a value, the consumer will read the parameter first.
* If the Dubbo Sdk you are using contains the serialization type, the serialization method specified by the argument is used.
* <p>
* When this parameter is null or the serialization type specified by this parameter does not exist in the Dubbo SDK, the serialization type specified by serialization is used.
* If the Dubbo SDK if still does not exist, the default type of the Dubbo SDK is used.
* For Dubbo SDK >= 3.2, <code>preferSerialization</code> takes precedence over <code>serialization</code>
* <p>
* The configuration supports multiple, which are separated by commas.Such as:<code>fastjson2,fastjson,hessian2</code>
*/
String preferSerialization() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

public class StubMethodDescriptor implements MethodDescriptor, PackableMethod {
private static final Logger logger = LoggerFactory.getLogger(StubMethodDescriptor.class);
private final ServiceDescriptor serviceDescriptor;
private final ConcurrentMap<String, Object> attributeMap = new ConcurrentHashMap<>();
private final String methodName;
private final String[] compatibleParamSignatures;
Expand All @@ -46,14 +45,12 @@ public StubMethodDescriptor(
String methodName,
Class<?> requestClass,
Class<?> responseClass,
StubServiceDescriptor serviceDescriptor,
RpcType rpcType,
Pack requestPack,
Pack responsePack,
UnPack requestUnpack,
UnPack responseUnpack) {
this.methodName = methodName;
this.serviceDescriptor = serviceDescriptor;
this.rpcType = rpcType;
this.requestPack = requestPack;
this.responsePack = responsePack;
Expand All @@ -65,7 +62,6 @@ public StubMethodDescriptor(
this.compatibleParamSignatures =
Stream.of(parameterClasses).map(Class::getName).toArray(String[]::new);
this.returnTypes = new Type[] {responseClass, responseClass};
serviceDescriptor.addMethod(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ org.apache.commons.fileupload
org.apache.commons.jelly.
org.apache.commons.logging.
org.apache.commons.proxy.
org.apache.cxf.jaxrs.provider.
org.apache.hadoop.shaded.com.zaxxer.hikari.
org.apache.http.auth.
org.apache.http.conn.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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 org.apache.dubbo.common.vo.UserVo;
import org.apache.dubbo.rpc.model.HelloReply;
import org.apache.dubbo.rpc.model.HelloRequest;
import org.apache.dubbo.rpc.model.Person;
import org.apache.dubbo.rpc.model.SerializablePerson;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class ProtobufUtilsTest {

@Test
void testIsProtobufClass() {
Assertions.assertTrue(ProtobufUtils.isProtobufClass(HelloRequest.class));
Assertions.assertTrue(ProtobufUtils.isProtobufClass(HelloReply.class));
Assertions.assertFalse(ProtobufUtils.isProtobufClass(Person.class));
Assertions.assertFalse(ProtobufUtils.isProtobufClass(SerializablePerson.class));
Assertions.assertFalse(ProtobufUtils.isProtobufClass(UserVo.class));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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.rpc.model;

import com.google.protobuf.Message;

public final class HelloReply extends com.google.protobuf.GeneratedMessageV3 {

@Override
protected FieldAccessorTable internalGetFieldAccessorTable() {
return null;
}

@Override
protected Message.Builder newBuilderForType(BuilderParent builderParent) {
return null;
}

@Override
public Message.Builder newBuilderForType() {
return null;
}

@Override
public Message.Builder toBuilder() {
return null;
}

@Override
public Message getDefaultInstanceForType() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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.rpc.model;

import com.google.protobuf.Message;

public final class HelloRequest extends com.google.protobuf.GeneratedMessageV3 {

@Override
protected FieldAccessorTable internalGetFieldAccessorTable() {
return null;
}

@Override
protected Message.Builder newBuilderForType(BuilderParent builderParent) {
return null;
}

@Override
public Message.Builder newBuilderForType() {
return null;
}

@Override
public Message.Builder toBuilder() {
return null;
}

@Override
public Message getDefaultInstanceForType() {
return null;
}
}
Loading

0 comments on commit d018475

Please sign in to comment.