我有一个简单的ejabberd 18.09设置在域下运行测试组件:test.localhost
。
配置非常简单:
port: 8888
module: ejabberd_service
hosts:
"test.localhost":
password: "secret"
我已经将XEP-0114 / XMPP组件设置为通过Procfile运行多个实例:
test1: ./testcomponent --address localhost:8888 --secret ... --name test.localhost
test2: ./testcomponent --address localhost:8888 --secret ... --name test.localhost
test3: ./testcomponent --address localhost:8888 --secret ... --name test.localhost
现在,当我向test.localhost
下的任何联系人发送消息时,其中一个保证得到它。那很棒!对于任何给定的xmpp组件,您可以扩展到多个主机和节点,而无需担心单点故障。
有没有办法始终将发送到[email protected]
的消息路由到上面的test1
进程?也许使用[email protected]
作为联系人的test1实例发送的特定在线消息?
您应该使用值为bare_source
的“domain_balancing”选项。它将确保来自给定用户的所有数据包都到达同一个组件。文档在这里:https://docs.ejabberd.im/admin/guide/advanced/