mirror of
https://github.com/apache/rocketmq-dashboard.git
synced 2025-09-10 11:40:01 +08:00
Merge 77cc8a3ffa
into e57d423268
This commit is contained in:
@@ -38,6 +38,8 @@ import static org.apache.rocketmq.client.ClientConfig.SEND_MESSAGE_WITH_VIP_CHAN
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "rocketmq.config")
|
||||
public class RMQConfigure {
|
||||
private static final String ROCKET_MQ_AK_PROPERTY = "rocketmq.config.accessKey";
|
||||
private static final String ROCKET_MQ_SK_PROPERTY = "rocketmq.config.secretKey";
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(RMQConfigure.class);
|
||||
//use rocketmq.namesrv.addr first,if it is empty,than use system proerty or system env
|
||||
@@ -54,9 +56,9 @@ public class RMQConfigure {
|
||||
|
||||
private boolean loginRequired = false;
|
||||
|
||||
private String accessKey;
|
||||
private String accessKey = System.getProperty(ROCKET_MQ_AK_PROPERTY, System.getenv("ROCKET_MQ_AK"));
|
||||
|
||||
private String secretKey;
|
||||
private String secretKey = System.getProperty(ROCKET_MQ_SK_PROPERTY, System.getenv("ROCKET_MQ_SK"));
|
||||
|
||||
private boolean useTLS = false;
|
||||
|
||||
@@ -71,7 +73,11 @@ public class RMQConfigure {
|
||||
}
|
||||
|
||||
public void setAccessKey(String accessKey) {
|
||||
if (StringUtils.isNotBlank(accessKey)) {
|
||||
this.accessKey = accessKey;
|
||||
System.setProperty(ROCKET_MQ_AK_PROPERTY, accessKey);
|
||||
logger.info("setAccessKey accessKey={}", accessKey);
|
||||
}
|
||||
}
|
||||
|
||||
public String getSecretKey() {
|
||||
@@ -79,7 +85,11 @@ public class RMQConfigure {
|
||||
}
|
||||
|
||||
public void setSecretKey(String secretKey) {
|
||||
if (StringUtils.isNotBlank(secretKey)) {
|
||||
this.secretKey = secretKey;
|
||||
System.setProperty(ROCKET_MQ_SK_PROPERTY, secretKey);
|
||||
logger.info("setAccessKey accessKey={}", secretKey);
|
||||
}
|
||||
}
|
||||
|
||||
public String getNamesrvAddr() {
|
||||
|
Reference in New Issue
Block a user