Home Comments

NodeJS server-side app: Ice::FeatureNotSupportedException "object adapter endpoints not supported"

josedavidjosedavid ToledoMember Jose DavidOrganization: ZennioProject: Home automation remote
edited December 2019 in Comments

Hi,

I'm trying to migrate a python server-side application (Ice.Application), that I have been using for a long time, to NodeJS.

Ice version: 3.7.0

The problem is that after trying to make a first implementation I found this error (in addition to not loading the configuration with the parameter "--Ice.Config"):

::Ice::FeatureNotSupportedException
  unsupportedFeature: "object adapter endpoints not supported"

Nodejs server-side source code is:

"use strict";

const Ice = require("ice").Ice;

(async () => {

    let comm;

    try {

        const initData = new Ice.InitializationData();
        initData.properties = Ice.createProperties();

        initData.properties.setProperty("MyCustomServerAdapter.Endpoints","ssl -p 8008");
        initData.properties.setProperty("MyCustomServerAdapter.PublishedEndpoints","ssl -h localhost -p 8008");

    ...

        initData.properties.setProperty("MyCustom.IceStorm.TopicManager","IceStorm/TopicManager:ssl -h localhost -p 9999");
        initData.properties.setProperty("Ice.StdOut","./log/server/server.log");
        initData.properties.setProperty("Ice.StdErr","./log/server/server.err");
        initData.properties.setProperty("MyCustom.DbConnection","mysql://root:[email protected]/MyCustom?unix_socket=/var/run/mysqld/mysqld.sock");        

        initData.properties.setProperty("Ice.Plugin.IceSSL","IceSSL:createIceSSL");
        initData.properties.setProperty("IceSSL.DefaultDir","/home/user/certs/");
        initData.properties.setProperty("IceSSL.CAs","ca_cert.pem");
        initData.properties.setProperty("IceSSL.CertFile","full_cert.pem");

        comm = Ice.initialize(process.argv, initData);

        let adapter = await comm.createObjectAdapter('MyCustomServerAdapter');

        let properties = communicator.getProperties();

    } catch(ex) {
        console.log(ex.toString());
        process.exitCode = 1;
    } finally {
        if(comm) {
            await comm.destroy();
        }
    }
})();

Glacier2 configuration is:

Glacier2.Client.Endpoints=ssl -p 4063
Glacier2.Server.Endpoints=ssl
Glacier2.SessionTimeout=60
Glacier2.PermissionsVerifier=Glacier2/NullPermissionsVerifier


Ice.StdOut=./log/glacier2router/glacier2router.log
Ice.StdErr=./log/glacier2router/glacier2router.err


Ice.Plugin.IceSSL=IceSSL:createIceSSL
IceSSL.DefaultDir=/home/user/certs/
IceSSL.CAs=ca_cert.pem
IceSSL.CertFile=full_cert.pem

The original python server-side app:

class ServerApplication(Ice.Application):

    def run(self, args):

        comm = self.communicator()

        props = comm.getProperties()

        adapter = comm.createObjectAdapter('MyCustomServerAdapter')

        topic_mgr = comm.stringToProxy(props.getProperty('MyCustom.IceStorm.TopicManager'))

    # Add some interfaces to adapter here
    # like: device_announce = adapter.add(DeviceAnnounceI(manager, conn_manager), comm.stringToIdentity(props.getProperty('MyCustom.Announce.Device.Id')))
    # ....


        adapter.activate()
        self.callbackOnInterrupt()
        comm.waitForShutdown()

    def interruptCallback(self, arg):
        self.communicator().shutdown()

Is there any way to implement a nodejs server-side application without changing the way or properties with which client endpoints connect?

Thanks

Tagged:

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    Hi Jose David,

    As you just found the Ice for JavaScript server side support has some limitations, you cannot create an object adapter with an specific endpoints, the server side support just supports dispatch request over bidirectional connections which is not enough to create an Ice server in JavaScript.

    The JavaScript mapping limitations are described in https://doc.zeroc.com/ice/3.7/language-mappings/javascript-mapping

    If you want to create an Ice server C++, C#, Java, Python or Swift mappings have full server side support and are best suited for the task.

  • josedavidjosedavid ToledoMember Jose DavidOrganization: ZennioProject: Home automation remote

    Hi again,

    I take this thread to ask when there will be better support for the server-side in javascript. I would like to know especially if ZeroC intend to support two deficiencies that I have currently found in JS binding:

    • TLS
    • Object Adapter

    As well as what is necessary for it to be used to implement a server-side application as can be done in python for example.

    If ZeroC intend to support these characteristics, when? Any version and estimated date?

    Thanks!

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    Hi Jose David,

    We would like to add full server-side support to JavaScript. It's doable and it would be useful, however there are many other enhancements we want to implement as well, and adding server-side support to JavaScript is not a high priority at this point. It's currently not in the scope of the next release, Ice 4.0.

    If one of our customers needs this server-side support and wants to sponsor its implementation, this enhancement would become high priority and we could potentially deliver server-side JavaScript as part of the next Ice 3.7 patch release.

    All the best,
    Bernard

  • josedavidjosedavid ToledoMember Jose DavidOrganization: ZennioProject: Home automation remote

    Hi Bernard,

    I'm from a client company with a commercial license for many years and in principle we are interested in having the server-side support in JavaScript.

    Can you explain to me in more detail what is the sponsorship you mention or how can I get more information about it?

    Thanks,

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    Hi Jose David,

    Various enhancements to Ice were sponsored by our customers. For example, ETAS sponsored both the MATLAB language mapping and the Doxygen support for Slice. Thanks ETAS!

    In practice, it means we work with a customer to define what they need, research the work required, and then the sponsor/customer funds the development of this enhancement. To get started, the best is to contact us by email at [email protected]

    Best regards,
    Bernard

Sign In or Register to comment.