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

FOR shardingsphere5.3 dynamic config suggestion #24498

Closed
hyz1994121 opened this issue Mar 8, 2023 · 12 comments
Closed

FOR shardingsphere5.3 dynamic config suggestion #24498

hyz1994121 opened this issue Mar 8, 2023 · 12 comments

Comments

@hyz1994121
Copy link

hyz1994121 commented Mar 8, 2023

In my project i try upgrade shardingsphere from 5.1.1 to 5.3
i use shardingshpere jdbc by spring-namespace
after read this, https://community.sphere-ex.com/t/topic/1284 finished my upgrade
then i found some problem, in sharding.yaml i must use the real jdbcurl for datasource config
before, in my project ,we use ${jdbc.url} by apollo config to distinguish different environment,ex qa, ol

i found to build spring bean org.springframework.jdbc.datasource.SimpleDriverDataSource , i could set username, password by apollo config, but the url must use jdbc:shardingsphere:classpath:sharding.yaml like this,
to use prefix jdbc:shardingsphere:

though i could not use the dynamic config to distinguish the different enviroment.
in different env i must make 2 yaml file, it's very uncomfortable.

@hyz1994121
Copy link
Author

is anyone can help me?

@zhaojinchao95
Copy link
Contributor

@hyz1994121 You can look this : #23388

@hyz1994121
Copy link
Author

by the way, i found in 5.3.0 , i must use HikariDataSource for sharding.yaml, i wonder know if i can use the alibaba.druid for my DataSource. Becuase the druid provid some monitor for the db connection

@liming0
Copy link

liming0 commented Mar 30, 2023

I also encountered this issue when using nacos. sharding.yaml cannot reference the values of the configuration files in nacos

@794086163
Copy link

+1

@liming0
Copy link

liming0 commented Apr 27, 2023

I also encountered this issue when using nacos. sharding.yaml cannot reference the values of the configuration files in nacos

sharding现在感觉越做越脱离用户了感觉,搞的新东西完全摒弃原有的,并不兼容,低版本的bug也不修复fix,到高版本直接跨越式的升级,搞的我们在低版本和高版本之间还得手动在应用中重写来修复bug,有点蛋疼

Yes, the main issue is that there is still no smooth transition plan, but fortunately, SPI was provided. I implemented the configuration loading of NACOS myself and also replaced the values referenced by Spring's ${}

@strongduanmu
Copy link
Member

@liming0 Can you contribute your implement to upstream to help more users?

@apache apache deleted a comment from hyz1994121 Apr 27, 2023
@strongduanmu
Copy link
Member

The Nacos implementation comes from some community contributors, so it is not perfect now, and we hope that more developers will improve it so that it has a chance to become more stable.

@liming0
Copy link

liming0 commented Apr 27, 2023

@liming0 Can you contribute your implement to upstream to help more users?

Yes, I have removed the part about spring from my code. How can I contribute the code next

@strongduanmu
Copy link
Member

Hi @liming0, you can submit a new issue to describe your modify, and then we could discuss in this issue.

@liming0
Copy link

liming0 commented May 4, 2023

Hi @liming0, you can submit a new issue to describe your modify, and then we could discuss in this issue.

Sharding-jdbc supports nacos configuration
@strongduanmu

@github-actions github-actions bot added the stale label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants