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

namespace(xml),SNOWFLAKE,we can't use random? #3300

Closed
childewuque opened this issue Oct 17, 2019 · 2 comments
Closed

namespace(xml),SNOWFLAKE,we can't use random? #3300

childewuque opened this issue Oct 17, 2019 · 2 comments

Comments

@childewuque
Copy link

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response more than 7 days and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

4.0.0-RC2

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

Expected behavior

Invalid bean definition with name 'properties' defined in null: Could not resolve placeholder 'random.int(1000)'

Actual behavior

<bean:properties id="properties">
    <prop key="worker.id">${random.int(1000)}</prop>
</bean:properties>

<sharding:key-generator id="libKeyGenerator" type="SNOWFLAKE" column="id" props-ref="properties" />

Reason analyze (If you can)

format error?

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

@terrymanu
Copy link
Member

I have 2 suggestions:

  1. prop cannot support inline expression.
  2. using random as snowflake's work_id is not correct. work_id should be a static value of one node.

So I just close this issue and label it as invalid.

@childewuque
Copy link
Author

...,but RANDOM in SNOWFLAKE is very useful ,This makes deployment easier and simpler。
YAML can use it,XML should use it。In this way, SHARDING-JDBC is the unified and consistent usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants