问题标签 [sleekxmpp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
72 浏览

python - Python issue with time.sleep in sleekxmpp

I am using sleekxmpp as the xmpp client for python. The requests are coming which I am further forwarding to other users/agents.
Now the use case is, if a user is not available we need to check the availability every 10 seconds and transfer to him when he is available. We need to send a message to customer only 5 times but check the availability for a long time.

I am using time.sleep() if the user is not available to check again in 10 seconds, but the problem is it is blocking the entire thread and no new requests are coming to the server.

0 投票
2 回答
369 浏览

xmpp - SleekXMPP (Slixmpp) 服务器组件未从 ejabberd 接收所有 MUC 消息

我们想为 ejabberd 构建一个简单的服务器组件,接收发送到 MUC 房间的所有消息(我们有很多房间,并且一直在创建新房间),并在处理其中一些消息后执行一些操作。

我们不希望我们的服务器组件像机器人一样工作,所以我们不希望它回复消息或类似的东西,我们只希望它接收所有消息的副本以处理其中一些消息。

为此,我们遵循了此处提供的教程:https ://sleekxmpp.readthedocs.io/en/latest/getting_started/component.html

问题是该组件似乎只接收到一些消息(大约 5 条消息中的 1 条)。

此外,我们观察到一种奇怪的行为:消息传递似乎是“排他性的”,这意味着消息要么被传递到连接到房间的客户端,要么被传递到服务器组件,说实话这很奇怪。换句话说,5 条消息中的 1 条消息被传递到服务器组件,另外 4 条消息照常传递给客户端。

这是我们的组件代码(我们尝试过使用 slimxmpp 和 slixmpp,但我们总是有相同的行为):

这是我们的 ejabberd 18.03 配置的片段:

我们也尝试过使用 access、privilege_access 和类似的东西,但没有运气。

你知道什么可能导致这种奇怪的行为吗?是否应该启用任何特定的插件或模块?

当然,我们在 slimxmpp 和 ejabberd 上都启用了调试日志,但是我们没有看到任何错误,只是缺少消息。

我们还做了一项测试。即使使用 slixmpp 存储库中提供的官方“回声组件”示例,我们也会遇到同样的问题。所以看起来我们的服务器有问题,也许是消息路由部分,我们不知道。

谢谢

0 投票
1 回答
136 浏览

python - 使用 slimxmpp 发送消息在 process() 中挂起

所以我有这个小 Python 脚本,它从插入到 PostgreSQL 表中触发并传递 XMPP 消息。像魅力一样工作。现在升级到 Python 3.8(从 3.5)和 slimxmpp 1.3.3。(以前的 1.3.1)我有一个问题:它挂在process().

这是我的脚本:

请参阅send_XMPP()调用的方法process()

这就是我在日志文件中找到的内容——只是它的结尾,因为这段话一遍又一遍地重复:

所以我认为“无效的证书信任链”是罪魁祸首。但是如何规避呢?

0 投票
1 回答
42 浏览

python - 从 slimxmpp 传递到 slixmpp AttributeError: '_asyncio.Future' 对象没有属性 'find_all'

我正在使用 slixmpp 我已经在 slimxmpp 中完成了这些并试图传递给 slixmpp

for i in results.find_all('.//{jabber:x:data}value'): AttributeError: '_asyncio.Future' 对象没有属性 'find_all'