This is because we reassign messaging.messageCallback every time subscribe is called - https://github.com/ClearBlade/JavaScript-API/blob/master/index.js#L2174
Currently the only way to subscribe to multiple topics is by creating a new messaging client for each topic which results in a new websocket connection. It would be nice if we could reuse the same connection.
Proposed fix: keep a reference to the callbacks in a dictionary where the keys are the topic name and then in onMessageArrived (https://github.com/ClearBlade/JavaScript-API/blob/master/index.js#L2088) we would find which callback we need to call.
Side note: we should also understand the performance tradeoffs of using multiple connections for multiple topics vs. one connection for multiple topics.