Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client url字符串问题,route redis配置更新 #134

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

baiyina
Copy link
Contributor

@baiyina baiyina commented Jul 25, 2024

client url字符串多 / ,route redis配置更新

client url字符串多 / ,route redis配置更新
在运行server和route的时候发现会报log4j的错,虽不影响运行但尝试解决,是zkclient下的log4j未配置原因,于是在commen中添加配置文件
@@ -13,7 +13,7 @@ cim.msg.logger.path = /opt/logs/cim/


# route url suggested that this is Nginx address
cim.route.url = http://localhost:8083/
cim.route.url = http://localhost:8083
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to adress the campatibility issue here:

public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
JSONObject jsonObject = new JSONObject();
String serverUrl = url + "/" + method.getName() ;
if (args != null && args.length > 1) {

e.g:

String serverUrl = url + "/" + method.getName() ;
URI uri = new URI(serverUrl);
String fixedUrl = uri.normalize().toString();
...
return HttpClient.call(okHttpClient, jsonObject.toString(), fixedUrl);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的杰哥,已经改了

使用uri.normalize校验url规范性,更健壮。
Copy link
Owner

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crossoverJie crossoverJie merged commit c6c3db7 into crossoverJie:master Jul 26, 2024
@crossoverJie crossoverJie added the bug Something isn't working label Jul 30, 2024
@crossoverJie crossoverJie added this to the 
v2.0.0 milestone Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants