Project

General

Profile

External component issues

Robert Larsen
Added about 5 years ago

Hi

I have a server with 12 vhosts and will use it for both IM, MUC and as middleware for casual gaming.

The games will be developed as XEP-0114 based components.

Is there a way to specify wildcards for the names? Such as:

--external = *.{DOMAIN}:secret:listen:5275

...so that I don't have to specify the same component for each of the 12 hosts and also so I don't have to reconfigure the server for each game (I may get many).

Alternatively, is there an adhoc command for adding to the external list?

Also, if I have this:

--external = backgammon.domain1.com:secret:listen:5275,backgammon.domain2.com:secret

...users on each domain can see both when using service discovery.

Is there a way to hide this without having a Tigase installation per domain? That is, so that users on domain1.com cannot see backgammon.domain2.com.

Thanks


Replies (7)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 5 years ago

I suggest you look at the XEP-0225 instead. It is also for external components but allows you for more options, such as supporting multiple domains and external components on a single connection.

Also, if you use Tigase's API for component development you get this all for included. You can deploy Tigase component as an internal component or as an external one and you do not have to worry about this at development time.

Added by Robert Larsen about 5 years ago

Thanks for your reply. I'll take a look at XEP-0225.

I prefer using external components because of the freedom it provides. At the moment we use ejabberd in production but want to change to Tigase. From a game development viewpoint that is easy because we are not tied up to anyones API.

Is there a way of adding new externals (xep-0114 or xep-0225 based) without restarting the server?

If not, can you point me to where I might add such an adhoc command?

Added by Wojciech Kapcia TigaseTeam about 5 years ago

You can add new external items using comp-repo-item-add adhoc admin command on ext@domain JID, eg.:

<iq type="set" to="ext@domain" id="ext1">
<command xmlns="http://jabber.org/protocol/commands" node="comp-repo-item-add"/>
</iq>

Added by Robert Larsen about 5 years ago

Nice...almost there. However many commands fail with "java.lang.NullPointerException: Neither attribute key or value can be set to null." including this one.

The component is added, since I can later do a 'comp-repo-item-update', and it appears in the list of available domains. That command fails too when being executed thou.

And the port I specify is not opened.

I specify the following information:

Domain name: services.cego.dk

Domain password: secret

Connection type: accept

Port number: 5275

Remote host:

Protocol:

Load balancer class: tigase.server.ext.lb.ReceiverBareJidLB

(Optional) Routings:

Owner: robert78@komogvind.dk

Administrators:

Is there a way to see failing line in the groovy script?

Anything else I can try?

Added by Wojciech Kapcia TigaseTeam about 5 years ago

I assume that you specified Remote host instead of leaving it empty? For protocol, as --external documentation on tigase.org says you should use either accept or @connect@.

Nevertheless - which Tigase version do you use? I've just tried latest nightly and even with missing protocol and host entries the item is added correctly.

Added by Robert Larsen about 5 years ago

Server version is "Tigase ver. 5.2.0-b3447/48635d0a (2014-02-12/17:29:15)"

Actually I left Remote host empty since I specified an 'accept' @Connection type@. Shouldn't remote host only be specified if Tigase were to connect to the external? The doc says "can be skipped for 'listen' connection type".

I now tried with:

Domain name: services.cego.dk

Domain password: secret

Connection type: accept

Port number: 5275

Remote host:

Protocol: accept

Load balancer class: tigase.server.ext.lb.ReceiverBareJidLB

(Optional) Routings:

Owner: robert78@komogvind.dk

Administrators:

Same result. An exception and the port is not opened, however the component is listed when I execute the comp-repo-item-remove command.

The documentation talks about a 'listen' Connection type but Tigase itself calls it 'accept':

<field label="Connection type"
       var="Connection type"
       type="list-single">
 <value>
  accept
 </value>
 <option label="accept">
  <value>
   accept
  </value>
 </option>
 <option label="connect">
  <value>
   connect
  </value>
 </option>
</field>

My command in its entirety:

<iq to="ext@komogvind.dk"
    id="32"
    type="set"
    xmlns="jabber:client">
    <command xmlns="http://jabber.org/protocol/commands"
             node="comp-repo-item-add"
             action="complete">
        <x xmlns="jabber:x:data"
           type="submit">
            <field var="Domain name">
                <value>
                    test.cego.dk
                </value>
            </field>
            <field var="Domain password">
                <value>
                    secret
                </value>
            </field>
            <field var="Connection type">
                <value>
                    accept
                </value>
            </field>
            <field var="Port number">
                <value>
                    9988
                </value>
            </field>
            <field var="Remote host">
                <value>
                </value>
            </field>
            <field var="Protocol">
                <value>
                    accept
                </value>
            </field>
            <field var="Load balancer class">
                <value>
                    tigase.server.ext.lb.ReceiverBareJidLB
                </value>
            </field>
            <field var="(Optional) Routings">
                <value>
                </value>
            </field>
            <field var="Owner">
                <value>
                    robert78@komogvind.dk
                </value>
            </field>
            <field var="Administrators">
                <value>
                </value>
            </field>
            <field var="command-marker">
                <value>
                    command-marker
                </value>
            </field>
            <field var="notify-cluster">
                <value>
                    true
                </value>
            </field>
        </x>
    </command>
</iq>

And the response:

<iq xmlns="jabber:client"
    id="32"
    to="robert78@komogvind.dk/tigase-3"
    from="ext@komogvind.dk"
    type="result">
    <command xmlns="http://jabber.org/protocol/commands"
             status="completed"
             node="comp-repo-item-add">
        <x xmlns="jabber:x:data"
           type="result">
            <field var="Note"
                   type="fixed">
                <value>
                    Script execution error.
                </value>
            </field>
            <field var="Error message"
                   type="fixed">
                <value>
                    java.lang.NullPointerException: Neither attribute key or value can be set to null.
                </value>
            </field>
            <field var="Debug info"
                   type="text-multi">
                <value>
                    java.lang.NullPointerException: Neither attribute key or value can be set to null.
                </value>
                <value>
                    javax.script.ScriptException: java.lang.NullPointerException: Neither attribute key or value can be set to null.
                </value>
                <value>
                    org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:349)
                </value>
                <value>
                    org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)
                </value>
                <value>
                    tigase.server.script.Script.runCommand(Script.java:182)
                </value>
                <value>
                    tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:1051)
                </value>
                <value>
                    tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1464)
                </value>
                <value/>
            </field>
        </x>
    </command>
</iq>

Added by Wojciech Kapcia TigaseTeam about 5 years ago

Can you try latest nightly (preferably on cleared instance)? Do you happen to have separate tigase-utils/-xmltools jar binaries (currently they are inlined in main tigase-server.jar binary so if there are separate ones then they should be removed).

I've again tried to reproduce the issue and can't trigger NPE that you receive.

However, I've found out that currently, despite changes to configuration made by the script, new service won't be started. We will work on this functionality.

    (1-7/7)