Pregunta

I'm subscribing to 'queue:1.2.3'. How does the client know if they have successfully subscribed? Is there a mechanism for the server to respond to the client?

Below is a simple program that I'm using to test the subscriptions. I'm not sure what to show on the server side.

var sess;
var wsuri = 'ws://test.lan:8000';

window.onload = function() {
    // connect to WAMP server
    ab.connect(wsuri,

        // WAMP session was established
        function (session) {
            sess = session;
            console.log("Connected to " + wsuri);
        },

        // WAMP session is gone
        function (code, reason) {
            sess = null;
            console.log("Connection lost (" + reason + ")");
        }
    );
};

function subscribe()
{
    sess.subscribe("queue:1.2.3", topicReceived)
}

function topicReceived(topicUri, event)
{
    console.log(topicUri + ' ' + event)
}

I feel like this post touches on my question: Calling dispatch in subscribe in Autobahn

¿Fue útil?

Solución

Not in WAMPv1. A acknowledgement (with subsription ID) or a subscribe error (with error URI) will be part of WAMPv2 which is currently in the cooking.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top