In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the use of Vertx as a mqtt client". In daily operation, I believe that many people have doubts about the use of Vertx as a mqtt client. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the question of "what is the use of Vertx as a mqtt client?" Next, please follow the editor to study!
Introduction of vertx-mqtt
Io.vertx vertx-mqtt 3.8.2int count = 1000 vertx vertx = Vertx.vertx (); MqttClient client = MqttClient.create (vertx, new MqttClientOptions (). SetMaxInflightQueue (count)); client.connect (1883, "192.168.1.24", s-> {if (s.succeeded () {for (int I = 0; I)
< count; i++) { client.publish("temperature", Buffer.buffer("hello" + i), MqttQoS.AT_LEAST_ONCE, false, false); } } }).pingResponseHandler(s ->{log.info ("We have just received PINGRESP packet");}); for (int I = 0; I
< count; i++) { TimeUnit.MILLISECONDS.sleep(500); try { client.publish("temperature", Buffer.buffer(i + "hello" + i), MqttQoS.AT_LEAST_ONCE, false, false); } catch (Exception e) { log.error("error"); client.connect(1883, "192.168.1.24", s ->{if (s.succeeded ()) {for (int j =-count; j < 0; jacks +) {client.publish ("temperature", Buffer.buffer ("hello" + j), MqttQoS.AT_LEAST_ONCE, false, false) At this point, the study on "what is the use of Vertx as a mqtt client" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 261
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.