Messages sent by a component to an XMPP offline user
I have a nice component that, at a certain time, sends an XMPP message to an user. While I was testing on PSI with online users, it worked like a charm, the user got a message from email@example.com and everything looked fine.
If the user is offline, instead, I get a 404 error like the one below
2014-12-22 17:06:22.521 [in_0-message-router] MessageRouter.processPacket() FINEST: Processing packet: from=null, to=null, DATA=<message xmlns="jabber:client" from="firstname.lastname@example.org/Smack" type="error" to="email@example.com"><body>my message</body><action xmlns="http://www.domain.com/extensions/message#action" type="my action" id="u1lkX-8"/><error code="404" type="wait"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">The recipient is no longer available.</text></error></message>, SIZE=453, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error
I suspect that I have to insert a particular recipient to deliver at packet-level, but I couldn't find any indication of that... it just seems strange that having from=null, to=null can be correct !
Can this be related to the non-delivered messages to offline recipients ?
Thanks in advance,
Added by Wojciech Kapcia about 4 years ago
Given that you address your message to FullJID (i.e.
firstname.lastname@example.org/Smack@) and most likely you do not set the type, and [RFC1621](http://xmpp.org/rfcs/rfc6121.html#rules-localpart-fulljid) states that only messages of type @chat should be stored for offline delivery.
Added by Luca Stucchi about 4 years ago
I was making some tests right now and I discovered the setting type to chat it worked... looking for the error code that I got I saw that it stripped out the resource, so that's what I was testing a minute before you answered me. And now I even know why !
To me, as far as I get the messages, I have no problem in stripping resource away ! Do you see any possible drawback of this ?
All the best,