user1455836
user1455836

Reputation: 752

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.

Upvotes: 0

Views: 148

Answers (2)

Wojtek
Wojtek

Reputation: 2064

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

Upvotes: 1

Artur Hefczyc
Artur Hefczyc

Reputation: 996

Yes, the Tigase component Framework/API requires Tigase Server core to run. And you only load the Tigase server core with your custom component. Shared database between Tigase main XMPP Server and component instance is recommended for simplicity but not mandatory. I think the external component instance could be even run with dummy DB connector, if DB is really not needed.

Upvotes: 0

Related Questions