 setInterval(function () {
               counter += 1;
               var value = Math.random();
               session.publish('com.example.oncounter', [counter, value]);
               console.log("published to topic 'com.example.oncounter'", counter, value);
            }, 1000);
         };


         // fired when connection was lost (or could not be established)
         //
         connection.onclose = function (reason, details) {
            console.log("Connection lost: " + reason);
         }


 