        var counter = args[0];
            console.log("on_counter() event received with counter " + counter);
        }

        session.subscribe('com.example.oncounter', on_counter).then(
                function (sub) {
                    console.log('subscribed to topic');
                },
                function (err) {
                    console.log('failed to subscribe to topic', err);
                }
        );


        // PUBLISH an event every second
        //
        t1 = setInterval(fu