-
Notifications
You must be signed in to change notification settings - Fork 541
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
Unsubscribe surprisingly breaks previous subscribe #336
Comments
I think this is the same issue I ran into: --- a/router.go
+++ b/router.go
@@ -105,7 +105,7 @@ func (r *router) addRoute(topic string, callback MessageHandler) {
r.Lock()
defer r.Unlock()
for e := r.routes.Front(); e != nil; e = e.Next() {
- if e.Value.(*route).match(topic) {
+ if e.Value.(*route).topic == topic {
r := e.Value.(*route)
r.callback = callback
return |
Had exactly the same issue with And in my app I expect: |
Closing this because a fix was committed a year ago; please feel free to reopen if its still an issue. |
Subscribing to
/a/#
works correctly.However, if one subscribes to
/a/b/#
and unsubscribes from it afterwards, the earlier message handler doesn't receive anything anymore, although the broker publishes according totcpdump
.To reproduce:
And publish messages from the console with:
My expectation is to receive those messages. In practice, nothing happens.
To verify that the example isn't broken itself, remove the last
Subscribe
andUnsubscribe
.The text was updated successfully, but these errors were encountered: