hbmqtt
hbmqtt copied to clipboard
broker example missing topic_config
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:
-
import os
is not used - 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'
-
-
- Explain
topic-check
/topic_config
in the docs because they are missing
+1 Is there any documentation or examples for learning how to access the messages received by the broker?
https://github.com/beerfactory/hbmqtt/blob/master/docs/references/broker.rst There you go.