junxi-coder commented on issue #34860:
URL: 
https://github.com/apache/shardingsphere/issues/34860#issuecomment-2702644415

   My version is also Spring 3 and ShardingSphere 5.5.1. When using multiple 
sharding strategies and loading algorithm implementation classes via SPI, I 
encountered the same issue. I believe this is caused by version incompatibility.
   
   Additionally, I found that the defaultTableStrategy configuration did not 
take effect, and I had to manually specify a strategy for each table that does 
not require sharding.
   
   `dataSources:
     ds0:
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
       driverClassName: com.mysql.jdbc.Driver
       url: 
jdbc:mysql://xxxxxxxxxxxx:3306/message_dispatch?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT
       username: xxxxxxxxxx
       password: xxxxxxxx
       props:
         initialSize: 5
         maxActive: 20
         minIdle: 5
         maxWait: 60000
   
   rules:
   - !SHARDING
     defaultTableStrategy:
       none:  # 关闭默认的分表策略
     defaultDatabaseStrategy:
       none:  # 关闭默认的分库策略
     tables:
       in_app:
         actualDataNodes: ds0.in_app
       in_app_access:
         actualDataNodes: ds0.in_app_access
       in_app_access_config:
         actualDataNodes: ds0.in_app_access_config
       in_app_group:
         actualDataNodes: ds0.in_app_group
       in_app_group_user:
         actualDataNodes: ds0.in_app_group_user
       in_app_template:
         actualDataNodes: ds0.in_app_template
       in_app_text:
         actualDataNodes: ds0.in_app_text
       in_app_record_old:
         actualDataNodes: ds0.in_app_record_old
       in_app_record:
         actualDataNodes: ds0.in_app_record_${0..7}
         tableStrategy:
           standard:
             shardingColumn: user_no
             shardingAlgorithmName: consistent-hash-algo
   #      keyGenerateStrategy:
   #        column: id
   #        keyGeneratorName: uuid
   #      auditStrategy:
   #        auditorNames:
   #          - sharding_key_required_auditor
   #        allowHintDisable: true
   #  defaultShardingColumn: user_no
     shardingAlgorithms:
       consistent-hash-algo:
         type: COMPLEX
         props:
           logical-table-name: in_app_record
           algorithm-expression: 
com.msl.message.in.app.sharding.ConsistentHashShardingAlgorithm
           sharding-count: 8
   
   
   #  keyGenerators:
   #    uuid:
   #      type: UUID
   #    snowflake:
   #      type: SNOWFLAKE
   #      props:
   #        worker-id: 123
   
   
   
   
   
   
   
   props:
     sql-show: true
   
   
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to