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

when set clusters for subscribe not trigger callback #761

Open
tureo opened this issue Jun 12, 2024 · 6 comments
Open

when set clusters for subscribe not trigger callback #761

tureo opened this issue Jun 12, 2024 · 6 comments

Comments

@tureo
Copy link

tureo commented Jun 12, 2024

What version of nacos-sdk-go are you using?

v2.2.6

What version of nacos-sever are you using?

v2.0.2

What version of Go are you using (go version)?

go version go1.22.2 linux/amd64

What operating system (Linux, Windows, …) and version?

linux,uos

What did you do?

If possible, provide a recipe for reproducing the error.
when set clusters for subscribe callback not trigger

SubscribeCallback: func(services []model.Instance, err error) {

//Subscribe key=serviceName+groupName+cluster
//Note:We call add multiple SubscribeCallback with the same key.
subscribeParam := &vo.SubscribeParam{
ServiceName: "demo.go",
GroupName: "group-a",
Clusters: []string{"cluster-a"}, // this set clusters bug
SubscribeCallback: func(services []model.Instance, err error) {
fmt.Printf("callback return services:%s \n\n", util.ToJsonString(services))
},
}
subscribe(client, subscribeParam)

What did you expect to see?

callback trigger

What did you see instead?

callback not trigger

@binbin0325
Copy link
Member

Check if cluster-A cluster exists in nacos server

@youzhixiaomutou
Copy link

I met the same situation, subscribe is not working when clusters was set.
Maybe I can repait it.

@youzhixiaomutou
Copy link

image
image
clusters in notify reply is empty.

@youzhixiaomutou
Copy link

@tureo It works well with nacos server v2.4.1. But not work with v2.0.2 and v2.1.0.

@tureo
Copy link
Author

tureo commented Oct 18, 2024

@tureo It works well with nacos server v2.4.1. But not work with v2.0.2 and v2.1.0.

@youzhixiaomutou Thank you, our Nacos server version cannot be upgraded, so our temporary solution is to temporarily not set the cluster value

@tureo
Copy link
Author

tureo commented Oct 18, 2024

Check if cluster-A cluster exists in nacos server

@binbin0325 Yes, I am certain that cluster-a exists in Nacos, and here are some details and solutions for reproducing it

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