Skip to content

Commit

Permalink
feat(config): apache#13299 Add configuration for triple
Browse files Browse the repository at this point in the history
  • Loading branch information
oxsean committed Nov 3, 2023
1 parent ec37470 commit 7c84a4d
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
*/
public class RegistryConfig extends AbstractConfig {

public static final String NO_AVAILABLE = "N/A";
private static final long serialVersionUID = 5508512956753757169L;

public static final String NO_AVAILABLE = "N/A";

/**
* Register center address.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@
import java.io.IOException;
import java.io.InputStream;

/**
* Configuration for ssl.
*
* @export
*/
public class SslConfig extends AbstractConfig {

private static final long serialVersionUID = 4072725016922915851L;

public static final String SERVER_KEY_CERT_CHAIN_PATH = "server-key-cert-chain-path";

public static final String SERVER_PRIVATE_KEY_PATH = "server-private-key-path";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.dubbo.rpc.model.ApplicationModel;

/**
* TracingConfig
* Configuration for tracing.
*/
public class TracingConfig extends AbstractConfig {

Expand Down
106 changes: 106 additions & 0 deletions dubbo-common/src/main/java/org/apache/dubbo/config/TripleConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* 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.config;

import java.io.Serializable;

/**
* Configuration for triple protocol.
*/
public class TripleConfig implements Serializable {

private static final long serialVersionUID = -3682252713701362155L;

/**
* The header table size.
*/
private String headerTableSize;

/**
* Whether to enable push, default is false.
*/
private Boolean enablePush;

/**
* Maximum concurrent streams.
*/
private String maxConcurrentStreams;

/**
* Initial window size.
*/
private String initialWindowSize;

/**
* Maximum frame size.
*/
private String maxFrameSize;

/**
* Maximum header list size.
*/
private String maxHeaderListSize;

public String getHeaderTableSize() {
return headerTableSize;
}

public void setHeaderTableSize(String headerTableSize) {
this.headerTableSize = headerTableSize;
}

public Boolean getEnablePush() {
return enablePush;
}

public void setEnablePush(Boolean enablePush) {
this.enablePush = enablePush;
}

public String getMaxConcurrentStreams() {
return maxConcurrentStreams;
}

public void setMaxConcurrentStreams(String maxConcurrentStreams) {
this.maxConcurrentStreams = maxConcurrentStreams;
}

public String getInitialWindowSize() {
return initialWindowSize;
}

public void setInitialWindowSize(String initialWindowSize) {
this.initialWindowSize = initialWindowSize;
}

public String getMaxFrameSize() {
return maxFrameSize;
}

public void setMaxFrameSize(String maxFrameSize) {
this.maxFrameSize = maxFrameSize;
}

public String getMaxHeaderListSize() {
return maxHeaderListSize;
}

public void setMaxHeaderListSize(String maxHeaderListSize) {
this.maxHeaderListSize = maxHeaderListSize;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.SslConfig;
import org.apache.dubbo.config.TracingConfig;
import org.apache.dubbo.config.TripleConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

Expand Down Expand Up @@ -116,6 +117,12 @@ public class DubboConfigurationProperties {
@NestedConfigurationProperty
private SslConfig ssl = new SslConfig();

/**
* Configuration properties for rpc.
*/
@NestedConfigurationProperty
private RpcConfig rpc = new RpcConfig();

// Multiple Config Bindings

/**
Expand Down Expand Up @@ -264,6 +271,14 @@ public void setSsl(SslConfig ssl) {
this.ssl = ssl;
}

public RpcConfig getRpc() {
return rpc;
}

public void setRpc(RpcConfig rpc) {
this.rpc = rpc;
}

public Map<String, ModuleConfig> getModules() {
return modules;
}
Expand Down Expand Up @@ -343,4 +358,24 @@ public Map<String, TracingConfig> getTracings() {
public void setTracings(Map<String, TracingConfig> tracings) {
this.tracings = tracings;
}

/**
* Configuration for rpc.
*/
public static class RpcConfig {

/**
* The triple config.
*/
@NestedConfigurationProperty
private TripleConfig tri;

public TripleConfig getTri() {
return tri;
}

public void setTri(TripleConfig tri) {
this.tri = tri;
}
}
}
13 changes: 7 additions & 6 deletions dubbo-spring-boot/dubbo-spring-boot-compatible/metadata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

<properties>
<skip_maven_deploy>true</skip_maven_deploy>
<sources_directory>${project.build.directory}/generated-sources/java</sources_directory>
</properties>

<dependencies>
Expand Down Expand Up @@ -90,18 +91,18 @@
</goals>
<configuration>
<target>
<delete dir="${project.build.directory}/generated-sources/java" quiet="true"/>
<copy todir="${project.build.directory}/generated-sources/java">
<delete dir="${sources_directory}" quiet="true"/>
<copy todir="${sources_directory}">
<fileset dir="../../../dubbo-common/src/main/java">
<include name="org/apache/dubbo/config/**/*.java"/>
</fileset>
</copy>
<replace token="@Nested" value="@org.springframework.boot.context.properties.NestedConfigurationProperty">
<fileset dir="${project.build.directory}/generated-sources/java">
<fileset dir="${sources_directory}">
<include name="**/*.java"/>
</fileset>
</replace>
<copy todir="${project.build.directory}/generated-sources/java">
<copy todir="${sources_directory}">
<fileset dir="../autoconfigure/src/main/java">
<include name="**/DubboConfigurationProperties.java"/>
</fileset>
Expand All @@ -117,7 +118,7 @@
</goals>
<configuration>
<target>
<delete dir="${project.build.directory}/generated-sources/java" quiet="true"/>
<delete dir="${sources_directory}" quiet="true"/>
</target>
</configuration>
</execution>
Expand All @@ -135,7 +136,7 @@
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/java</source>
<source>${sources_directory}</source>
</sources>
</configuration>
</execution>
Expand Down

0 comments on commit 7c84a4d

Please sign in to comment.