emqx-auth-redis icon indicating copy to clipboard operation
emqx-auth-redis copied to clipboard

Weird multiple-subscription

Open pewh opened this issue 7 years ago • 2 comments

Hello,

I have set ACL on redis for topic "inbox/123" with value 3 (which means support both pub & sub)

Later, I subscribe "inbox/#" topic. When I publish "inbox/123", I don't receive message.

But if I subscribe "inbox/#" and "inbox/123" topics, and publish "inbox/123", then I receive message for each topics (inbox/# and inbox/123).

Is this normal behavior?

pewh avatar Oct 13 '17 16:10 pewh

My use case is: there will be many "inbox/<id>" topics with each ACL. If user subscribe "inbox/#", then it will receive message from topic that has matched ACL.

For example: topics: inbox/1, with ACL for user: 123 inbox/2, with ACL for user: 456 inbox/3, with ACL for user: 123

user 123 subscribe "inbox/#" user 456 subscribe "inbox/#"

if admin publish message with topic "inbox/1", then "user 123" should be receive message, but "user 456" shouldn't receive message.

My question is: am I doing correct for this mqtt pattern (or is there any bad side-effect)? Can emqtt doing things like my usage? Thank you.

pewh avatar Oct 13 '17 16:10 pewh

Hi, @pewh Sorry for the late reply,Do you resolve this problem?

turtleDeng avatar Dec 31 '19 09:12 turtleDeng