shardingsphere-jdbc standard alg. initialization problem
Which version of ShardingSphere did you use?
5.0.0-RC1-SNAPSHOT
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
problem
standard sharding algorithm configuration not loaded
configuration below:
spring:
shardingsphere:
dataSources:
...
rules:
sharding:
tables:
quantityaggregationdata:
logicTable: quantityaggregationdata
actualDataNodes: shardingdata.quantityaggregationdata_0_$->{0..7}
tableStrategy:
standard:
shardingColumn: logtime
shardingAlgorithmName: range-sharding
tx: com.example.demosharding.strategy.ShardingAlgorithm
keyGenerateStrategy:
column: id
keyGeneratorName: snowflake
shardingAlgorithms:
range-sharding:
type: BOUNDARY_RANGE
props:
sharding-ranges: 0, 10, 20, 30, 40, 50, 60, 70
cause I cannot find some useful configuration example except for INLINE sharding, i'm not sure my config is properly set.
In my opinion, maybe the initation function's not called before doSharding. like this.

Maybe complex sharding's got the same problem as well.
thank you!
You can refer to the following configuration documents: Spring Boot Sharding Configuration Spring Boot Sharding Algorithm Configuration Here is complete Spring Boot Example
You can refer to the following configuration documents: Spring Boot Sharding Configuration Spring Boot Sharding Algorithm Configuration Here is complete Spring Boot Example
thanks for your reply.
I've read the document, a detailed configuration example. Yet my main question still remains. I mean, the initialization of algorithm is not properly triggered while applicaition''s started, few clue's found. Couldyou check out this for me? thank you.
BTW, I suggest buildin complex algorithm like range + hash etc.
Meanwhile, what''s the difference between autotable and table?
You can refer to the following configuration documents: Spring Boot Sharding Configuration Spring Boot Sharding Algorithm Configuration Here is complete Spring Boot Example
thanks for your reply.
I've read the document, a detailed configuration example. Yet my main question still remains. I mean, the initialization of algorithm is not properly triggered while applicaition''s started, few clue's found. Couldyou check out this for me? thank you.
BTW, I suggest buildin complex algorithm like range + hash etc.
Have you ever tried inserting data? The result is your expect?
Yeah I tried. like this:
- the initiazation never triggered.

- after manually init and got partitionRange, another error occured. Integer cast to Long problem.

For Q1, can you make a breakpoint here, ensure the algorithm is loaded.

By the way your code is lastest?
sorry for replying late.
I made a pull yesterday, it's almost latest. I made the breakpoint by it's not loaded. howhowever the bean BoundaryBasedRangeShardingAlgorithm is loaded, I can't find any clue.

btw. my configuration's like below, I can't find anything wrong with that but the init is never loaded.

Did you have a custom BeanPostProcessor? It seem some class skipped auto proxying.
nope, it's only a simple demo. few classes were created except for ordinary controller/repository and druid connection. I can't see anything special
Oh sorry, My FAULT. After reCreating a demo project, it's ok to init. maybe some class's made the skip, I'll find that. thank you for your patience. problem closed.