路由到支持 ejabberd 中单个域的特定 XEP-0114 实例?
Routing to specific XEP-0114 instances backing a single domain in ejabberd?
我有一个简单的 ejabberd 18.09 设置 运行 在域下设置一个测试组件:test.localhost
。
配置超简单:
port: 8888
module: ejabberd_service
hosts:
"test.localhost":
password: "secret"
我已经通过 Procfile 将我的 XEP-0114 / XMPP 组件设置为 运行 多个实例:
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 组件,您似乎都可以扩展到多个主机和节点,而不必担心单点故障。
有没有办法始终将发送到 user1@test.localhost
的消息路由到上面的 test1
进程?也许使用 test1 实例发送的特定在线消息,联系人为 user1@test.localhost
?
您应该使用值为 bare_source
的选项“domain_balancing”。它将确保来自给定用户的所有数据包都到达同一组件。
文档在这里:https://docs.ejabberd.im/admin/guide/advanced/
我有一个简单的 ejabberd 18.09 设置 运行 在域下设置一个测试组件:test.localhost
。
配置超简单:
port: 8888
module: ejabberd_service
hosts:
"test.localhost":
password: "secret"
我已经通过 Procfile 将我的 XEP-0114 / XMPP 组件设置为 运行 多个实例:
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 组件,您似乎都可以扩展到多个主机和节点,而不必担心单点故障。
有没有办法始终将发送到 user1@test.localhost
的消息路由到上面的 test1
进程?也许使用 test1 实例发送的特定在线消息,联系人为 user1@test.localhost
?
您应该使用值为 bare_source
的选项“domain_balancing”。它将确保来自给定用户的所有数据包都到达同一组件。
文档在这里:https://docs.ejabberd.im/admin/guide/advanced/