Project

General

Profile

General Question

Derek H
Added over 5 years ago

Hi,

This is just a general question about this component.

1) In general, what's the difference between a plugin and a component. That was not really made clear to me.

My Goal is to:

Create a mechanism where the tigase XMPP server can translate the messages received into a specified JSON format and have that sent to a specified URL (another client or server). This include group chats and being aware of users that are available, etc.

It seems like this is what the HTTP API component does? If that is the case, can this be used along side other Components such as the MUC Component meaning that the messages handled by MUC is processed through the HTTP API component as well.

Thanks,

D


Replies (3)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Plugins are modules which are loaded in to Components. For example SM plugins are modules which are loaded into Session Manager component. So in general plugins are usually smaller pieces of code responsible for a particular task or processing particular kind of XMPP packets whereas components are bigger entity with own, unique XMPP address which can be installed as internal code in to the Tigase server or as an external component.

XMPP is generally an XML based protocol and Tigase handles all the XMPP packets in XML format internally too. Therefore the best way to translate XMPP packets from XML to JSON and deliver them to a client would be in a connection manager component. A connection manager component is a component responsible for a low level protocol stuff and delivery data over the network. I suppose you could start with existing Bosh component or WebSockets component and create own version which serializes XMPP packets as JSON data instead of XML data.

Added by Derek H over 5 years ago

Where can i get more information about the WebSocket component or Bosh component.

The only information I found was located here:

http://www.tigase.org/content/websockets (is there a way to actually comment/reply to those post)

I'm a new to using tigase, so I'm still trying to figure how things are configured. I using the windows version tigase-server-5.1.5-b3164

I dl both the http API dependency and put it into the /jar directory and also the associated scripts.

Is the WebSocket come with tigase-server or does that need to be downloaded as well (where would I find the source or binary)

Here is my init file:

--user-db = pgsql

--admins = admin@localhost,admin@bib

--user-db-uri = jdbc:postgresql://localhost/tigasedb?user=tigase&password=bib

config-type = --gen-config-def

--virt-hosts = bib,localhost,any-other-domain,BLOS1

--debug = server,xmpp.XMPPIOService,cluster

--sm-plugins=message

--comp-name-3=rest

--comp-class-3=tigase.http.rest.RestMessageReceiver

--comp-class-5 = tigase.server.websocket.WebSocketClientConnectionManager

--comp-name-5 = ws2s

Below is my console output:

C:\Tigase>java -cp "jars/tigase-server.jar;libs/*" -Djdbc.drivers=com.mysql.jdbc.Driver tigase.server.XMPPServer --property-file etc/init.properties

2013-09-22 14:35:55 DNSResolver.() WARNING: Resolving default host name took: 36

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Setting defaults: --property-file=etc/init.properties

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Loading initial properties from property file: etc/init.properties

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (config-type=--gen-config-def)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--debug=server,xmpp.XMPPIOService,cluster)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--user-db=pgsql)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--admins=admin@localhost,admin@bib)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--user-db-uri=jdbc:postgresql://localhost/tigasedb?user=tigase&password=bib)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-class-5=tigase.server.websocket.WebSocketClientConnectionManager)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--virt-hosts=bib,localhost,any-other-domain,BLOS1)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-name-5=ws2s)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-name-3=rest)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-class-3=tigase.http.rest.RestMessageReceiver)

2013-09-22 14:35:55 ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--sm-plugins=message)

2013-09-22 14:35:55 MessageRouter.addRegistrator() INFO: Adding registrator: Configurator

2013-09-22 14:35:55 MessageRouter.addComponent() INFO: Adding component: Configurator

2013-09-22 14:35:55 ConfiguratorAbstract.componentAdded() CONFIG: component: basic-conf

2013-09-22 14:35:55 ConfiguratorAbstract.setup() CONFIG: Setting up component: basic-conf

2013-09-22 14:35:55 ConfiguratorAbstract.setup() CONFIG: Component basic-conf defaults: {component-id=basic-conf@blos1.bacn0.net, def-hostname=blos1.bacn0.net, admins=[Ljava.lang.String;@56a3ed9f, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, logging/tigase.xmpp.XMPPIOService.level=ALL, logging/tigase.cluster.level=ALL, user-domain-repo-pool

=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=1, user-repo-class=pgsql, user-repo-url=jdbc:postgresql://localhost/tigasedb?user=tigase&password=bib, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:postgresql://localhost/tigasedb?user=tigase&password=bib, ssl-container-class=tigase.io.SSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default}

2013-09-22 14:35:55 ConfiguratorAbstract.setup() CONFIG: Component basic-conf configuration: {component-id=basic-conf@blos1.bacn0.net, def-hostname=blos1.bacn0.net, admins=[Ljava.lang.String;@56a3ed9f, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, logging/tigase.xmpp.XMPPIOService.level=ALL, logging/tigase.cluster.level=ALL, user-domain-repo

-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=1, user-repo-class=pgsql, user-repo-url=jdbc:postgresql://localhost/tigasedb?user=tigase&password=bib, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:postgresql://localhost/tigasedb?user=tigase&password=bib, ssl-container-class=tigase.io.SSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default}

java.lang.ClassNotFoundException: tigase.http.rest.RestMessageReceiver

    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Class.java:190)

    at tigase.server.MessageRouterConfig.getMsgRcvInstance(MessageRouterConfig.java)

    at tigase.server.MessageRouter.setProperties(MessageRouter.java)

    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java)

    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java)

    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java)

    at tigase.server.MessageRouter.setConfig(MessageRouter.java)

    at tigase.server.XMPPServer.main(XMPPServer.java)

Loading plugin: session-close=4 ...

Loading plugin: session-open=4 ...

Loading plugin: default-handler=4 ...

Loading plugin: jabber:iq:register=2 ...

Loading plugin: jabber:iq:auth=8 ...

Loading plugin: urn:ietf:params:xml:ns:xmpp-sasl=8 ...

Loading plugin: urn:ietf:params:xml:ns:xmpp-bind=2 ...

Loading plugin: urn:ietf:params:xml:ns:xmpp-session=2 ...

Loading plugin: jabber:iq:roster=16 ...

Loading plugin: jabber:iq:privacy=2 ...

Loading plugin: jabber:iq:version=2 ...

Loading plugin: http://jabber.org/protocol/stats=2 ...

Loading plugin: starttls=2 ...

Loading plugin: vcard-temp=2 ...

Loading plugin: http://jabber.org/protocol/commands=2 ...

Loading plugin: jabber:iq:private=2 ...

Loading plugin: urn:xmpp:ping=2 ...

Loading plugin: presence=16 ...

Loading plugin: disco=2 ...

Loading plugin: pep=2 ...

Loading plugin: amp=2 ...

Loading plugin: message=2 ...

java.lang.ClassNotFoundException: tigase.server.websocket.WebSocketClientConnectionManager

    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Class.java:190)

    at tigase.server.MessageRouterConfig.getMsgRcvInstance(MessageRouterConfig.java)

    at tigase.server.MessageRouter.setProperties(MessageRouter.java)

    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java)

    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java)

    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java)

    at tigase.server.MessageRouter.setConfig(MessageRouter.java)

    at tigase.server.XMPPServer.main(XMPPServer.java)

Thanks,

D

Added by Wojciech Kapcia TigaseTeam over 5 years ago

You don't have to do anything to enable websockets (nor BOSH), but they are only available in the beta versions of 5.2.0.

I would recommend trying out latest beta of 5.2.0 which already have all components (REST) bundled.

    (1-3/3)