我正在嘗試使用camel-xmpp-組件從 [email protected] 向用戶 [email protected] 發送一條(私人)直接消息。但它總是說“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-clientfrom("timer:sendMessage?period=5000")
.setBody(constant("test"))
.to("xmpp:[email protected]:5222/[email protected]?user=A&password=xxx");我本想發送一條消息,但它登錄成功,發送時我在日志中收到以下錯誤:o.a.c.c.xmpp.XmppLogger | INBOUND : <message to='[email protected]/Camel' from='[email protected]@chat:[email protected]: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: [email protected]@chat:[email protected]:A</text></error></message>感謝您的任何想法。
2 回答

慕田峪7331174
TA貢獻1828條經驗 獲得超13個贊
創建私人消息時,線程名稱會附加到 JID 中。
我不是 XMPP 或 Smack 方面的專家,但 Openfire(就我而言)似乎對 JID 中的線程名稱不滿意。刪除線程名稱后,我可以發送私人消息。
添加回答
舉報
0/150
提交
取消