Replies: 3 comments 6 replies
-
Hi @AriesMg |
Beta Was this translation helpful? Give feedback.
-
@thjaeckle i want control Thousands Of router via dittclient,how many dittclients should I create on my server? just 1 enough or need more? |
Beta Was this translation helpful? Give feedback.
-
As there are only new (unrelated) questions and not a feedback on my questions and suggestions, I will close this discsussion (as this is not a discussion). |
Beta Was this translation helpful? Give feedback.
-
when i use dittoclient, it will disconnect at every 10 minutes ,why?
use client
client.live().forId(thingId)
.message()
.to()
.subject("routercmd")
.timeout(Duration.ofSeconds(60))
.payload(JSONObject.toJSONString(requestBody))
.send(String.class, (response, throwable) -> {
future.complete(response.getPayload().orElse(null));
});
String s = future.get(3000, TimeUnit.MILLISECONDS);
logger.info("call result ={}" ,s);
RouterResponseBody responseBody = JSONObject.parseObject(s, RouterResponseBody.class);
create client
public DittoClient create() throws Exception {
log.info("start create ditto client");
return DittoClients.newInstance(createMessagingProvider())
.connect()
.toCompletableFuture()
.join();
Beta Was this translation helpful? Give feedback.
All reactions