mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge pull request #993 from akiyamamioty/feature/add-validation-on-nameserver
add validation on nameServer
This commit is contained in:
commit
16e9494487
@ -16,21 +16,27 @@
|
|||||||
|
|
||||||
package com.alibaba.cloud.stream.binder.rocketmq.properties;
|
package com.alibaba.cloud.stream.binder.rocketmq.properties;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
|
||||||
import com.alibaba.cloud.stream.binder.rocketmq.RocketMQBinderConstants;
|
import com.alibaba.cloud.stream.binder.rocketmq.RocketMQBinderConstants;
|
||||||
import org.apache.rocketmq.common.MixAll;
|
import org.apache.rocketmq.common.MixAll;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Timur Valiev
|
* @author Timur Valiev
|
||||||
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
|
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "spring.cloud.stream.rocketmq.binder")
|
@ConfigurationProperties(prefix = "spring.cloud.stream.rocketmq.binder")
|
||||||
|
@Validated
|
||||||
public class RocketMQBinderConfigurationProperties {
|
public class RocketMQBinderConfigurationProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name server for rocketMQ, formats: `host:port;host:port`.
|
* The name server for rocketMQ, formats: `host:port;host:port`.
|
||||||
*/
|
*/
|
||||||
|
@Pattern(regexp = "^[\\d.:;]+$",
|
||||||
|
message = "nameServer needs to match expression \"host:port;host:port\"")
|
||||||
private String nameServer = RocketMQBinderConstants.DEFAULT_NAME_SERVER;
|
private String nameServer = RocketMQBinderConstants.DEFAULT_NAME_SERVER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user