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

[Question]Why change flow rule id to "string" #534

Open
xiangtianyu opened this issue Jun 13, 2023 · 5 comments
Open

[Question]Why change flow rule id to "string" #534

xiangtianyu opened this issue Jun 13, 2023 · 5 comments

Comments

@xiangtianyu
Copy link

In golang sdk the flow rule id is changed from uint64 to string, but the java sdk is still "Long".

So when i tried to use nacos store the rule and shared it to both my java app and golang app, it will report

Fail to convert source bytes to []*flow.Rule, err: json: cannot unmarshal number into Go struct field Rule.id of type stringExiting

How can i handle this situation.

@binbin0325
Copy link
Collaborator

need to investigate the use of id in java,is it necessary?

@sczyh30
Copy link
Member

sczyh30 commented Jun 13, 2023

Previous discussions: alibaba/Sentinel#2853

@binbin0325
Copy link
Collaborator

1: Maybe we can use the json.Number as the id type, compatible with older versions.
2: Implements logSlot to print logs

@xiangtianyu
Copy link
Author

not only id, the flow block threshold count in java sdk names "count", but in golang, it names "threshold". These difference makes me difficult to do compatible between java and golang

@binbin0325
Copy link
Collaborator

java and go will not be exactly the same,you can forget java and reconfigure according to golang

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

No branches or pull requests

3 participants