Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.3/master

Operating System version: mac

Java version: 1.8

Steps to reproduce this issue

问题描述

简写属性

embedded.zookeeper.port=2181
dubbo.registry.address=zookeeper://127.0.0.1:${embedded.zookeeper.port}
dubbo.metadata-report.address=zookeeper://127.0.0.1:${embedded.zookeeper.port}
dubbo.config-center.address=zookeeper://127.0.0.1:${embedded.zookeeper.port}

程序启动后，在dubbo-master分支${embedded.zookeeper.port}值为NULL。

原因分析

dubbo-master代码

@Override
public Object getProperty(String key, Object defaultValue) {
Object value = null;
if (StringUtils.isNotEmpty(prefix)) {
if (StringUtils.isNotEmpty(id)) {
value = getInternalProperty(prefix + id + "." + key);
}
if (value == null) {
value = getInternalProperty(prefix + key);
}
} else {
value = getInternalProperty(key);
}
return value != null ? value : defaultValue;
}

InmemoryConfiguration里面的store存取的值是没有前缀的，如："address" -> "zookeeper://127.0.0.1:2181"、"prefix" -> "dubbo.config-center"、"namespace" -> "henry1"等。所以在getInternalProperty(prefix + key);获取失败的。然后会进入PropertiesConfiguration获取，但是里面的数据结构为，如："dubbo.registry.address" -> "zookeeper://127.0.0.1:${embedded.zookeeper.port}"。但是解析${embedded.zookeeper.port}时，参数集合里是没有的，因为OverrideDubboConfigApplicationListener将所有非dubbo.开头的全部过滤掉了，除非将embedded.zookeeper.port改成dubbo.embedded.zookeeper.port就可以了。

2.7.3代码

@Override
public Object getProperty(String key, Object defaultValue) {
Object value = null;
if (StringUtils.isNotEmpty(prefix) && StringUtils.isNotEmpty(id)) {
value = getInternalProperty(prefix + id + "." + key);
}
if (value == null && StringUtils.isNotEmpty(prefix)) {
value = getInternalProperty(prefix + key);
}

if (value == null) {
value = getInternalProperty(key);
}
return value != null ? value : defaultValue;
}

为什么2.7.3代码可以的，因为getInternalProperty(prefix + key);获取为NULL后，会继续走getInternalProperty(key)，所以值取出来了。

但是master 这样写是为了解决在windows下获取环境变量path，长度超长(之前我遇到的问题是这样)。

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

我不知道这个算不算BUG，但是怕后面的人会遇到，还是建了一个issue。

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!

Issue 2:
AcceLogFilter message creation and last and current check was performing by each time simple date formate object creation. In this version of code I have use the ThreadLocal for each thread wise to create simple date format object instead of each call.

I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.0

Operating System version: xxx

Java version: xxx

Steps to reproduce this issue

xxx

xxx

xxx

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps？

Actual Result

What actually happens?

AcceLogFilter message creation and last and current check was performing by each time simple date formate object creation. In this version of code I have use the ThreadLocal for each thread wise to create simple date format object instead of each call.

If there is an exception, please attach the exception trace:

Just put your stack trace here!