New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket closed when subscribe 3000 topics #152

Open
flynn-shu opened this Issue Apr 25, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@flynn-shu

flynn-shu commented Apr 25, 2018

AMQJS0008I Socket closed

    function onConnect() {
        // Once a connection has been made, make a subscription and send a message.
        console.log("onConnect");
        // client.subscribe("World");
		//about 3000 topics
        for (var i = 0; i < topics.length; i++) {
            var topic = topics[i];
            for (var key in topic) {
                client.subscribe(key);
				//console.log("subscribe:"+key); when add this line will be ok. It seems to be blocking  
 current thread
            }
        }

    }

    // called when the client loses its connection
    function onConnectionLost(responseObject) {
        if (responseObject.errorCode !== 0) {
            console.log("onConnectionLost:" + JSON.stringify(responseObject));
        }else{
			console.log("onConnectionLost:" + 0 );
		}
    }

How to subscribe to multiple topics using one request?
If have any idea how to solve this issue, please help me!

@jpwsutton

This comment has been minimized.

Show comment
Hide comment
@jpwsutton

jpwsutton May 8, 2018

Member

In the version of the client currently in the develop branch, you can now subscribe to multiple topics in an array:
client.subscribe(["tennis", "football", "rugby"]);

This will be available in the release version sometime in late June.

Member

jpwsutton commented May 8, 2018

In the version of the client currently in the develop branch, you can now subscribe to multiple topics in an array:
client.subscribe(["tennis", "football", "rugby"]);

This will be available in the release version sometime in late June.

@jpwsutton jpwsutton self-assigned this May 8, 2018

@jpwsutton jpwsutton added the question label May 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment