【问题标题】:503 "service-unavailable" error when querying for the archive of a given user (mod_mam)查询给定用户的存档时出现 503“服务不可用”错误 (mod_mam)
【发布时间】:2017-06-30 14:10:42
【问题描述】:

我正在尝试通过mod_mam 在 ejabberd(来自 jessie-backports 的 16.09)中查询用户的消息存档(如示例 2 中所示。用户查询他们的存档以获取消息) ,但不断收到“没有模块正在处理此查询”错误。

与服务器的交互是通过Babbler Java 客户端完成的。

这是自定义有效负载类:

@XmlRootElement(name = "query", namespace = "urn:xmpp:mam:2")
@XmlAccessorType(XmlAccessType.FIELD)
public final class UserMessageArchiveQuery {

  @XmlAttribute(name = "queryid")
  private String queryId;

  public UserMessageArchiveQuery() {}

  public String getQueryId() {
    return queryId;
  }

  public void setQueryId(String string) {
    this.queryId = string;
  }
}

然后将其添加到会话配置中。

XmppSessionConfiguration sessionConfiguration =
  XmppSessionConfiguration
    .builder()
    .extensions(Extension.of(UserMessageArchiveQuery.class))
    .build();

现在我们可以建立连接了,因为我可以相应地发送和接收消息。

XmppClient client = XmppClient.create("localhost", sessionConfiguration, tcpConfiguration, boshConfiguration);
client.connect();
client.login("someuser", password);

这就是事情向南发展的地方。为给定的用户和有效负载准备 IQ,并查询服务器:

UserMessageArchiveQuery payload = new UserMessageArchiveQuery();
IQ iq = IQ.set(Jid.of("someuser@localhost"), payload);
return client.query(iq).getResult();

查看 ejabberd 日志,发送到服务器的结果 XML 如下:

<iq id="47a6204a-6ac3-453b-9dfd-7488ec6de734" to="someuser@localhost" type="set">
    <query xmlns="urn:xmpp:mam:2"></query>
</iq>

我们得到的:

packet {xmlel,<<"iq">>,[{<<"type">>,<<"error">>},{<<"from">>,<<"someuser@localhost">>},{<<"xml:lang">>,<<"en-US">>},{<<"id">>,<<"47a6204a-6ac3-453b-9dfd-7488ec6de734">>}],[{xmlel,<<"query">>,[{<<"xmlns">>,<<"urn:xmpp:mam:2">>}],[]},{xmlel,<<"error">>,[{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],[{xmlel,<<"service-unavailable">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],[]},{xmlel,<<"text">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],[{xmlcdata,<<"No module is handling this query">>}]}]}]}

我确信 mod_mam 已启用并正常工作,因为我可以在“存档”表中看到存档消息。我不知道如何进一步。

【问题讨论】:

    标签: java xmpp ejabberd


    【解决方案1】:

    ejabberd 目前不支持 urn:xmpp:mam:2。

    【讨论】:

      猜你喜欢
      • 2016-03-11
      • 2013-07-29
      • 2016-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多