Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. jmsTemplate.convertAndSend("topic", "Hello World!");
  2.  
  3. let mqtt = require('mqtt')
  4. let options ={
  5. clientId:"test",
  6. username:"username",
  7. useSSL: true,
  8. password:"password",
  9. clean:true};
  10. let client = mqtt.connect(
  11. 'wss://someUrl.com:61619',
  12. options);
  13.  
  14. client.on('connect', function () {
  15. client.subscribe('myTopic', function (err) {
  16. if (!err) {
  17. console.log("successfully connected to myTopic'");
  18. }
  19. })
  20. });
  21.  
  22. client.on('message', function (topic, message) {
  23. console.log(message.toString());
  24. });
  25.  
  26. S�A S�)�x-opt-jms-destQ�x-opt-jms-msg-typeQ Ss� f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement