Hacı Ali Mizrak
Hacı Ali Mizrak

Reputation: 13

stomp.js with multiple topics subscribe reads

As in MQTT, can I subscribe to all topics using the "#" character with Stomp?

var onConnect = function(frame) {
      debug("connected to MQTT");
      $('#connect').fadeOut({ duration: 'fast' });
      $('#connected').fadeIn();
      client.subscribe('#');
    };
/* ------------------------------ */
client.connect(login, passcode, function(frame) {
            client.debug("connected to Stomp");
client.subscribe('#', function(message) {});
});

Upvotes: 1

Views: 1765

Answers (2)

Ferhat KOÇER
Ferhat KOÇER

Reputation: 4075

You can use example :

for stomp

XXX.YYY.ZZZ  => XXX.YYY.>
(it will be get all topics with contains  XXX.YYY topics  )

for mqtt

XXX/YYY/ZZZ  => XXX/YYY/#
(it will be get all topics with contains  XXX.YYY topics  )

Upvotes: 0

Tim Bish
Tim Bish

Reputation: 18376

No STOMP does not as a protocol have that sort of addressing definition built into the specification so it never supported that sort of global subscription. The address model in STOMP mostly adheres to the same as that of the ActiveMQ JMS client when it comes to wildcards which you can read about here.

Upvotes: 1

Related Questions