【发布时间】:2020-01-29 18:54:54
【问题描述】:
我正在尝试使用 camel-xmpp 组件从 A@jabber.de 向用户 B@jabber.de 发送(私人)直接消息。但它总是说“jid-malformed”。 使用此文档:https://camel.apache.org/components/latest/xmpp-component.html
使用 camel 2.24.2 和 java 8,但在 java 11 上存在同样的问题。 我还尝试在 MessageHeaders 中设置“from”和“to”。 我还查看了组件的源代码,它总是将“from”-JID 构建为带有“chat@...”的东西,这与使用 smack 库的所有其他教程不同,如下所示:https://www.baeldung.com/xmpp-smack-chat-client
from("timer:sendMessage?period=5000")
.setBody(constant("test"))
.to("xmpp:A@jabber.de:5222/B@jabber.de?user=A&password=xxx");
我希望发送一条消息,但它成功登录,发送时我在日志中收到以下错误:
o.a.c.c.xmpp.XmppLogger | INBOUND : <message to='A@jabber.de/Camel' from='B@jabber.de@chat:B@jabber.de:A' id='BdCI4-9' type='error'><error type='modify'><jid-malformed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>The destination address is invalid: B@jabber.de@chat:B@jabber.de:A</text></error></message>
感谢您的任何想法。
【问题讨论】:
-
我在直接向用户发送消息时遇到类似问题,但可以接收消息并发送到聊天室。我也将不胜感激对此的任何想法。使用 Camel 2.24.2 和 Openfire 4.4.3
标签: java apache-camel xmpp