Giter Club home page Giter Club logo

Comments (2)

pinchpe avatar pinchpe commented on May 20, 2024 1

The fix is very simple but looks like I don't have permissions to push and submit a PR. Here's the patch:

topics $ git diff 53a79caad9f0c09ebc4ce5953bb1c480f6ece5a0 memtopics.go 
diff --git a/broker/lib/topics/memtopics.go b/broker/lib/topics/memtopics.go
index eb81345..012cf3c 100644
--- a/broker/lib/topics/memtopics.go
+++ b/broker/lib/topics/memtopics.go
@@ -244,6 +244,13 @@ func (this *snode) smatch(topic []byte, qos byte, subs *[]interface{}, qoss *[]b
        // let's find the subscribers that match the qos and append them to the list.
        if len(topic) == 0 {
                this.matchQos(qos, subs, qoss)
+
+               // Also need to consider subscribers to the multi-level wildcard since there can be subscribers _both_ to /foo/bar and /foo/bar/#
+               // Note that if a subscriber is subscribed to _both_ topics it is returned twice as it matches both topics.
+               if mwcn, _ := this.snodes[MWC]; mwcn != nil {
+                       mwcn.matchQos(qos, subs, qoss)
+               }
+
                return nil
        }
 

Updated tests: (a .go file which I changed to .txt so could attach)

memtopics_test.txt

from hmq.

chowyu08 avatar chowyu08 commented on May 20, 2024

yes, thanks very much

from hmq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.