Skip to content

Commit bcdebea

Browse files
committed
Merge branch '2.3.x'
2 parents 0664c01 + 76a7dc5 commit bcdebea

File tree

25 files changed

+524
-6
lines changed

25 files changed

+524
-6
lines changed

api-boot-project/api-boot-autoconfigure/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@
161161
<artifactId>minbox-oss</artifactId>
162162
<optional>true</optional>
163163
</dependency>
164+
<dependency>
165+
<groupId>org.minbox.framework</groupId>
166+
<artifactId>message-pipe-client</artifactId>
167+
<optional>true</optional>
168+
</dependency>
169+
<dependency>
170+
<groupId>org.minbox.framework</groupId>
171+
<artifactId>message-pipe-server</artifactId>
172+
<optional>true</optional>
173+
</dependency>
174+
<dependency>
175+
<groupId>org.minbox.framework</groupId>
176+
<artifactId>message-pipe-spring-context</artifactId>
177+
<optional>true</optional>
178+
</dependency>
164179

165180

166181
<!--Others-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package org.minbox.framework.api.boot.autoconfigure.message.pipe.client;
2+
3+
import org.minbox.framework.message.pipe.client.config.ClientConfiguration;
4+
import org.minbox.framework.message.pipe.spring.annotation.client.EnableMessagePipeClient;
5+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
6+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
7+
import org.springframework.context.annotation.Bean;
8+
9+
/**
10+
* The Message Pipe configuration
11+
*
12+
* @author 恒宇少年
13+
*/
14+
@ConditionalOnClass(ClientConfiguration.class)
15+
@EnableConfigurationProperties(MessagePipeClientProperties.class)
16+
@EnableMessagePipeClient
17+
public class MessagePipeClientAutoConfiguration {
18+
private MessagePipeClientProperties messagePipeClientProperties;
19+
20+
public MessagePipeClientAutoConfiguration(MessagePipeClientProperties messagePipeClientProperties) {
21+
this.messagePipeClientProperties = messagePipeClientProperties;
22+
}
23+
24+
/**
25+
* Create {@link ClientConfiguration} instance
26+
*
27+
* @return The {@link ClientConfiguration} instance
28+
* @see MessagePipeClientProperties#getConfiguration
29+
*/
30+
@Bean
31+
public ClientConfiguration clientConfiguration() {
32+
return messagePipeClientProperties.getConfiguration();
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.minbox.framework.api.boot.autoconfigure.message.pipe.client;
2+
3+
import lombok.Data;
4+
import org.minbox.framework.message.pipe.client.config.ClientConfiguration;
5+
import org.springframework.boot.context.properties.ConfigurationProperties;
6+
import org.springframework.boot.context.properties.NestedConfigurationProperty;
7+
8+
import static org.minbox.framework.api.boot.autoconfigure.message.pipe.client.MessagePipeClientProperties.MESSAGE_PIPE_PREFIX;
9+
10+
/**
11+
* The Message Pipe client config properties
12+
*
13+
* @author 恒宇少年
14+
*/
15+
@ConfigurationProperties(prefix = MESSAGE_PIPE_PREFIX)
16+
@Data
17+
public class MessagePipeClientProperties {
18+
/**
19+
* The config prefix for "message-pipe-client"
20+
*/
21+
public static final String MESSAGE_PIPE_PREFIX = "api.boot.message.pipe.client";
22+
/**
23+
* The {@link ClientConfiguration} client configuration
24+
*/
25+
@NestedConfigurationProperty
26+
private ClientConfiguration configuration = new ClientConfiguration();
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package org.minbox.framework.api.boot.autoconfigure.message.pipe.server;
2+
3+
import org.minbox.framework.message.pipe.server.config.MessagePipeConfiguration;
4+
import org.minbox.framework.message.pipe.server.config.ServerConfiguration;
5+
import org.minbox.framework.message.pipe.spring.annotation.server.EnableMessagePipeServer;
6+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
7+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
8+
import org.springframework.context.annotation.Bean;
9+
10+
/**
11+
* The Message Pipe Server configuration
12+
*
13+
* @author 恒宇少年
14+
*/
15+
@ConditionalOnClass(ServerConfiguration.class)
16+
@EnableConfigurationProperties(MessagePipeServerProperties.class)
17+
@EnableMessagePipeServer
18+
public class MessagePipeServerAutoConfiguration {
19+
private MessagePipeServerProperties messagePipeServerProperties;
20+
21+
public MessagePipeServerAutoConfiguration(MessagePipeServerProperties messagePipeServerProperties) {
22+
this.messagePipeServerProperties = messagePipeServerProperties;
23+
}
24+
25+
/**
26+
* Create {@link ServerConfiguration} instance
27+
*
28+
* @return The {@link ServerConfiguration} instance
29+
* @see MessagePipeServerProperties#getConfiguration
30+
*/
31+
@Bean
32+
public ServerConfiguration serverConfiguration() {
33+
return messagePipeServerProperties.getConfiguration();
34+
}
35+
36+
/**
37+
* Create {@link MessagePipeConfiguration}
38+
* <p>
39+
* The common configuration instance for each channel
40+
*
41+
* @return The {@link MessagePipeConfiguration} instance
42+
*/
43+
@Bean
44+
public MessagePipeConfiguration messagePipeConfiguration() {
45+
MessagePipeConfiguration configuration = MessagePipeConfiguration.defaultConfiguration();
46+
MessagePipeConfiguration.LockTime lockTime =
47+
new MessagePipeConfiguration.LockTime()
48+
.setLeaseTime(messagePipeServerProperties.getLockLeaseTime())
49+
.setTimeUnit(messagePipeServerProperties.getLockLeaseTimeUnit());
50+
configuration.setLockTime(lockTime);
51+
configuration.setDistributionMessagePoolSize(messagePipeServerProperties.getDistributionMessagePoolSize());
52+
return configuration;
53+
}
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.minbox.framework.api.boot.autoconfigure.message.pipe.server;
2+
3+
import lombok.Data;
4+
import org.minbox.framework.message.pipe.server.config.ServerConfiguration;
5+
import org.springframework.boot.context.properties.ConfigurationProperties;
6+
import org.springframework.boot.context.properties.NestedConfigurationProperty;
7+
8+
import java.util.concurrent.TimeUnit;
9+
10+
import static org.minbox.framework.api.boot.autoconfigure.message.pipe.server.MessagePipeServerProperties.MESSAGE_PIPE_PREFIX;
11+
12+
/**
13+
* The Message Pipe server config properties
14+
*
15+
* @author 恒宇少年
16+
*/
17+
@ConfigurationProperties(prefix = MESSAGE_PIPE_PREFIX)
18+
@Data
19+
public class MessagePipeServerProperties {
20+
/**
21+
* The config prefix for "message-pipe-server"
22+
*/
23+
public static final String MESSAGE_PIPE_PREFIX = "api.boot.message.pipe.server";
24+
/**
25+
* The {@link ServerConfiguration} server configuration
26+
*/
27+
@NestedConfigurationProperty
28+
private ServerConfiguration configuration = new ServerConfiguration();
29+
/**
30+
* The redisson lock lease time
31+
*/
32+
private long lockLeaseTime = 10;
33+
/**
34+
* The redisson lock lean {@link TimeUnit}
35+
*/
36+
private TimeUnit lockLeaseTimeUnit = TimeUnit.SECONDS;
37+
/**
38+
* The number of threads in the message thread pool
39+
*/
40+
private int distributionMessagePoolSize = 10;
41+
}

api-boot-project/api-boot-autoconfigure/src/main/resources/META-INF/spring.factories

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2222
org.minbox.framework.api.boot.autoconfigure.logging.admin.ApiBootLoggingAdminSecurityAutoConfiguration,\
2323
org.minbox.framework.api.boot.autoconfigure.sequence.ApiBootSequenceAutoConfiguration,\
2424
org.minbox.framework.api.boot.autoconfigure.mongo.ApiBootMongoClientSettingsAutoConfiguration,\
25-
org.minbox.framework.api.boot.autoconfigure.tools.ApiBootToolsAutoConfiguration
25+
org.minbox.framework.api.boot.autoconfigure.tools.ApiBootToolsAutoConfiguration,\
26+
org.minbox.framework.api.boot.autoconfigure.message.pipe.client.MessagePipeClientAutoConfiguration,\
27+
org.minbox.framework.api.boot.autoconfigure.message.pipe.server.MessagePipeServerAutoConfiguration

api-boot-project/api-boot-common/src/main/java/org/minbox/framework/api/boot/common/tools/ClassTools.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static Reflections initReflections(String scannerPackage) {
5555
* 获取指定package下的接口实现类
5656
*
5757
* @param scannerPackage 扫描的package
58+
* @param clazz The class type
5859
* @return 实现类集合
5960
*/
6061
public static Collection<?> getSubClassList(String scannerPackage, Class clazz) {

api-boot-project/api-boot-common/src/main/java/org/minbox/framework/api/boot/common/tools/ListTools.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class ListTools {
3535
/**
3636
* value converter to list
3737
*
38-
* @param value
39-
* @return
38+
* @param value The object value
39+
* @return list collection
4040
*/
4141
public static List<String> convertToList(Object value) {
4242
List<String> resourceUrls = new ArrayList<>();

api-boot-project/api-boot-dependencies/pom.xml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
<main.basedir>${basedir}/../..</main.basedir>
1717

1818
<!--Spring Projects-->
19-
<spring.version>5.2.7.RELEASE</spring.version>
19+
<spring.version>5.2.8.RELEASE</spring.version>
2020
<spring.boot.version>2.3.3.RELEASE</spring.boot.version>
2121

2222
<!--Minbox Projects-->
23-
<minbox-bom.version>1.0.1-SNAPSHOT</minbox-bom.version>
23+
<minbox-bom.version>1.0.1.RELEASE</minbox-bom.version>
2424
<code.builder.core.version>1.0.5.RELEASE</code.builder.core.version>
25+
<message-pipe.version>1.0.0.RELEASE</message-pipe.version>
2526

2627
<!--Others-->
2728
<druid.starter.version>1.1.21</druid.starter.version>
@@ -56,6 +57,14 @@
5657
<scope>import</scope>
5758
<type>pom</type>
5859
</dependency>
60+
<dependency>
61+
<groupId>org.minbox.framework</groupId>
62+
<artifactId>message-pipe-bom</artifactId>
63+
<version>${message-pipe.version}</version>
64+
<scope>import</scope>
65+
<type>pom</type>
66+
</dependency>
67+
5968
<!--SpringBoot Related Dependencies-->
6069
<dependency>
6170
<groupId>com.alibaba</groupId>
@@ -190,6 +199,16 @@
190199
<artifactId>api-boot-starter-mongo-client-settings</artifactId>
191200
<version>${project.version}</version>
192201
</dependency>
202+
<dependency>
203+
<groupId>org.minbox.framework</groupId>
204+
<artifactId>api-boot-starter-message-pipe-client</artifactId>
205+
<version>${project.version}</version>
206+
</dependency>
207+
<dependency>
208+
<groupId>org.minbox.framework</groupId>
209+
<artifactId>api-boot-starter-message-pipe-server</artifactId>
210+
<version>${project.version}</version>
211+
</dependency>
193212

194213

195214
<!--Others-->
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>api-boot-starters</artifactId>
7+
<groupId>org.minbox.framework</groupId>
8+
<version>${revision}</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
<packaging>jar</packaging>
12+
<artifactId>api-boot-starter-message-pipe-client</artifactId>
13+
<properties>
14+
<main.basedir>${basedir}/../../..</main.basedir>
15+
</properties>
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.minbox.framework</groupId>
19+
<artifactId>api-boot-starter</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.minbox.framework</groupId>
23+
<artifactId>message-pipe-client</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.minbox.framework</groupId>
27+
<artifactId>message-pipe-spring-context</artifactId>
28+
</dependency>
29+
</dependencies>
30+
<developers>
31+
<developer>
32+
<name>恒宇少年</name>
33+
<email>[email protected]</email>
34+
<organization>minbox-projects</organization>
35+
<organizationUrl>https://gitee.com/minbox-projects</organizationUrl>
36+
</developer>
37+
</developers>
38+
39+
</project>

0 commit comments

Comments
 (0)