kevoree / kevoree-library

Kevoree base library
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Callback function on send() #21

Closed tdalianis closed 8 years ago

tdalianis commented 8 years ago

Hi,

In http://kevoree.org/doc/#making-a-component I see that there is a callback function when you send a message. In newer versions the call method described there is replaced by the send(message,callback) method. I am sending a message to a component's input function that returns a string but nothing is printed in the callback.

outputPort.send("", new Callback(){

                public void onError(Throwable arg0) {
                    // TODO Auto-generated method stub
                    Log.info("error:"+arg0.toString());
                }

                public void onSuccess(CallbackResult arg0) {
                    // TODO Auto-generated method stub

                    Log.info("received message:"+arg0.toString());

                }

            });

Is the callback method still working? Is there a configuration that I need to do?

Thanks

maxleiko commented 8 years ago

The callback system can only work with a Channel that handles callbacks. There is only one of them currently and it needs a separate server (only available in Javascript).
But there is nothing that you cannot do by using the messaging system of Kevoree. Callbacks, in the end, are just a sugar on top of your input/outputs.