moscajs / ascoltatori

The pub/sub library for node backed by Redis, MongoDB, AMQP (RabbitMQ), ZeroMQ, MQTT (Mosquitto) or just plain node!
http://mcollina.github.com/ascoltatori
524 stars 122 forks source link

MQTT Clients cause kafka connector to crash because of $SYS #175

Open ddombrow opened 7 years ago

ddombrow commented 7 years ago

dollar sign is not allowed in kafka topics. Some clients seem to imediately try and publish to a $SYS_blahgdskjhgk_new_clients topic, which crashes mosca/kafka.

mcollina commented 7 years ago

@ddombrow how would you address this issue? Would you like to send a PR?

ddombrow commented 7 years ago

Wouldn't mind tackling it, just trying to think how to solve it. ascoltatori controls the topic management but it shouldn't be aware of special topics. I suppose it could accept the concept of a topic formatter function so that you can pass in your own replacer...

fullergalway commented 7 years ago

As a workaround mosca publishing to $SYS topics can be turned off by configuration. The settings below are taken from the kafka example.

     /*
     * avoid publishing to $SYS topics because
     * it violates kafka topic naming convention
     */
    stats: false,
    publishNewClient: false,
    publishClientDisconnect: false,
    publishSubscriptions: false,