powered by Jive Software

Component vs. Plugin?

I’m new to OpenFire development and based on the documentation I’ve read I’m unsure whether I need to implement my functionality as a component or as a plugin. I’ve seen examples of plugins that implement methods of the Component and Plugin classes. I’ve also seen the Tinder document that says you should implement AbstractComponent, but in the example they don’t extend Plugin. All I want to do at this point is send and receive custom data to/from a small number of users (max 500) and one central server. However, I want the benefits the AbstractComponent seems to provide.

Someone please educate me on the intended use of each of these classes. I’m so confused!


Not actually answering your question, but is your custom data point to point between users, or more of a pubésub model. If it is the latter, pubsub is already supported and would not require a plugin or component.

The data should only go back forth between the server and any clients connected to that central server. Yes, that does seem more like pubsub, however I want programatic control of what happens when the custom data is received by the server from a client. For example, I want to inspect the data that the client sends to the server and based on it possibly call a web service or connect to a database, etc. I then want control of the return messasge format and who the recipients of the message will be. If pubsub is already there and I can somehow customize how the data is sent out and received as I’ve described, then an example would be very helpful. I assumed a plugin or component would be th only way to have custom logic fire when custom messages are sent and received on the server side. That is what the examples seem to promote anyway, and those are confusing to me, hence my first question :slight_smile: I’m just a simple man trying to make his way in the openfire universe!

That doesn’t seem to fit the realm of pubsub, but you can definitely accomplish that via a plugin. Not sure about the component as I haven’t written one myself yet. I believe though that they are more oriented toward handling specific types of XMPP stanzas so that handling for specific extensions can be self contained and potentially separate from the XMPP server. Possibly you can define your own namespace for your custom messages and then use a component to handle that specific stanza type, but as I said, I haven’t done it so that is pure speculation.

Good luck.