Iq handler plugin

I am writing a plugin as an IQhandler.

any examples or links of plugins registered as IQhandler?

My plugin has to receive IQ packets with a particular namespace, then it has to process it, and then it has to send back an IQ response.Suggestions?

thanks in advance


You shouldn’t write plugin as IQHandler. Instead, you must implement Plugin and then regsiter your custom IQHandler like this:

public class MyPlugin implements Plugin {
IQHandler iqHandler = null;

public void initializePlugin(PluginManager manager, File pluginDirectory) {

iqHandler = new MyIQHandler(“My IQ handler”);
IQRouter iqRouter = XMPPServer.getInstance().getIQRouter();



Don’t forget to unregister your IQHandler on plugin destroy. Basically, the openfire plugins’ source code is a good place to start.