Wildcard handling, difference between Mosquitto/EMQX (could be EMQX bug)

Hi,

While switching from Mosquitto to EMQX, i noticed a difference in how Mosquitto and EMQX handle mixed wildcard subsriptions.
I use the following wildcards in my application:

  1. app/SerialA/state
  2. app/SerialA/+/#

Mosquitto will send these topic to my application:

  • app/SerialA/state
  • app/SerialA/Device1/state
  • app/SerialA/Device2/event

Mosquitto will NOT send these topics to my application:

  • app/SerialA/someOtherTopic

EMQX will send these topics to my application:

  • app/SerialA/state ← received twice
  • app/SerialA/Device1/state
  • app/SerialA/Device2/event
  • app/SerialA/someOtherTopic → not correct in my opinion (does not match the app/SerialA/+/# subscription)

The subscription “app/SerialA/+/#” states that at least 4 parts must be present in the topic. But EMQX filters messages with 3 topic parts with this subscription.

Using EMQX 5.3.0.

Hello,

That indeed looks like a bug. Could you submit an issue request on github?

P.S. Not a bug: Wildcard handling, difference between Mosquitto/EMQX · Issue #12360 · emqx/emqx · GitHub