hbmqtt icon indicating copy to clipboard operation
hbmqtt copied to clipboard

broker example missing topic_config

Open skewty opened this issue 5 years ago • 2 comments

import logging
import asyncio
import os
from hbmqtt.broker import Broker


@asyncio.coroutine
def broker_coro():
    broker = Broker()
    yield from broker.start()


if __name__ == '__main__':
    formatter = "[%(asctime)s] :: %(levelname)s :: %(name)s :: %(message)s"
    logging.basicConfig(level=logging.INFO, format=formatter)
    asyncio.get_event_loop().run_until_complete(broker_coro())
    asyncio.get_event_loop().run_forever()

A few issues:

  1. import os is not used
  2. if config is not passed to Broker() then the following warning is issued:
    • 'topic-check' section not found in context configuration
    • and when a client connects and tries to subscribe to a topic:
      • AttributeError: 'TopicTabooPlugin' object has no attribute 'topic_config'
  3. Explain topic-check / topic_config in the docs because they are missing

skewty avatar Mar 03 '19 23:03 skewty

+1 Is there any documentation or examples for learning how to access the messages received by the broker?

tartavull avatar Mar 15 '19 17:03 tartavull

https://github.com/beerfactory/hbmqtt/blob/master/docs/references/broker.rst There you go.

romancardenas avatar Apr 12 '19 08:04 romancardenas