bernard357 / shellbot

Fast, simple and lightweight micro bot-framework for Python.
Apache License 2.0
10 stars 3 forks source link

multi instance ko caused by ZMQ #31

Closed guillain closed 7 years ago

guillain commented 7 years ago

When a second bot is started on the same server ZMQ can't start as a process is already running. Need to have the capability to set ZMQ as global (possible?) Or define one instance by bot. Thanks in advance for your help

bernard357 commented 7 years ago

When the shellbot.bus module is started it checks for the variable settings bus.address and if none is set, it takes default value. So the trick to run multiple instances of shellbot on the same host is to set a different value for bus.address in individual configuration files. This should be better documented of course ... Is this enough information for you to proceed?

guillain commented 7 years ago

Yep,

Fixed as explained. Just be careful to the host declaration, localhost is not accepted when 127.0.0.1 works well

can be set as bellow:

export ZMQ_CONNECT="tcp://127.0.0.1:5555"

settings.py

settings = {     'bus.address': os.environ["ZMQ_CONNECT"], }

thanks