Smack how to send and listen for incoming Nonza

How to send Nonza with smack?
I hve a project and i need to send custom stanzas, which i assumed are called Nonzas, but so far i cant find any method to send or listen for incoming nonzas, i saw a method called sendNonza, but i was said to not be used by clients, so how does one send custom stanzas, and what implications are there if i just use the sendNonza function?

have tried extending the AbstractXmppTcpConnection to enable sending custom nonzas and listening for them also, but i dont think thats the right way to go about it

Do not use Nonzas. They are not an extension point for XMPP stanzas.

Instead, add a child element (one that uses a namespace that identifies your feature) to one of the existing stanza types (IQ, Message, or Presence).

For some background information, on how to extend XMPP stanzas, have a look at RFC 6120, specifically section 8.4.

also just to add to this, it isn’t advisable to send nonzas directly as this would make your stream unstable, its better you used a custom message presence or iq stanzas. if you must receive custom stanzas that aren’t among these standard stanzas, a work around but not advisable would be to do it in the DebuggerFactory where all incoming and outgoing streams are gotten before sent further, but not advisable, i don’t recommend anyone to do this.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.