Search code examples
componentsxmppexternaltigase

Tigase external component as a single jar


I've implemented tigase component with certain functionality and now trying to figure out how to use it as an external component. For now it seems I have to set up separate tigase server with my component on it and then configure main tigase server to refer to that separate server as an external component.

What I would like to do is to assemble that external tigase into a single jar in order to be able to run it with one line command without installing tigase upfront.

Question is is it possible at all?

It seems that tigase needs database to run and administration guide encourages to use shared main server's database for external components. I'm not sure if tigase can start without database which makes it rather hard to run with simple java -jar command.


Solution

  • For now it seems I have to set up separate tigase server with my component on it and then configure main tigase server to refer to that separate server as an external component.

    This is correct. Tigase XMPP server follows XEP-0114: Jabber Component Protocol and XEP-0225: Component Connections in this regard. Please refer to External Component Configuration for details how to configure it in Tigase.

    What I would like to do is to assemble that external tigase into a single jar in order to be able to run it with one line command without installing tigase upfront. Question is is it possible at all?

    You could create an "uber jar" - yes, that's possible. One of the possible solutions would be to create your component as a separate maven project, configure tigase-server as dependency and then take advantage of jar-with-dependencies of Apache Maven Assembly Plugin. It will pull all required, configured dependencies and place them in single jar file. Please note however, that for example database drivers won't be included.

    It seems that tigase needs database to run and administration guide encourages to use shared main server's database for external components. I'm not sure if tigase can start without database which makes it rather hard to run with simple java -jar command.

    Database is indeed required - this has the benefit of keeping your configuration consistent of many nodes that may run your external component (you need to updated only once on one node and all remaining nodes will update it automatically), but you don't have to use the main server database. Please see Usage with a separate database for details. If you are using only single, local instance of your external component then you can create a simple derby database and place your configuration in etc/externalComponentItems file