Skip to content

Commit

Permalink
Merge pull request alibaba#993 from akiyamamioty/feature/add-validati…
Browse files Browse the repository at this point in the history
…on-on-nameserver

add validation on nameServer
  • Loading branch information
fangjian0423 authored Oct 23, 2019
2 parents c52cbfb + 00f5e1a commit 16e9494
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,27 @@

package com.alibaba.cloud.stream.binder.rocketmq.properties;

import javax.validation.constraints.Pattern;

import com.alibaba.cloud.stream.binder.rocketmq.RocketMQBinderConstants;
import org.apache.rocketmq.common.MixAll;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

/**
* @author Timur Valiev
* @author <a href="mailto:[email protected]">Jim</a>
*/
@ConfigurationProperties(prefix = "spring.cloud.stream.rocketmq.binder")
@Validated
public class RocketMQBinderConfigurationProperties {

/**
* 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;

/**
Expand Down

0 comments on commit 16e9494

Please sign in to comment.