Hi y’all,
Im currently implementing a Android Messaging Service and i’m using HiveMQ Client Library with my HiveMQ-Cloud Broker.
I’m using the latest 1.3.1 release in my Android App and i’m facing some major issues.
Since i wanna develop in nearly RealTime, latency is a big point. But the latency while sending with the HiveMQ Client via Android is way to huge. For comparison i implemented the same client with Paho and HiveMQ in python and pure Java-Programm with latency beeing <50ms.
But as soon as i swap to my android app it goes around 3-4sec.
I also started a complete new Project and implemented only a button and a client but faced the same issues. The App got build on my Mac in a Emulator and on my HuaweiP30Pro.
Is there some related issue or know performance issues?
Big thanks in advance
The client i implemented for testing looks like this (the messages are received but with latency of >3sec)
Mqtt5AsyncClient client = Mqtt5Client
.builder()
.identifier("23")
.serverHost(host)
.serverPort(port)
.sslWithDefaultConfig()
.simpleAuth()
.username(username)
.password(password.getBytes())
.applySimpleAuth()
.buildAsync();
client.connectWith()
.send()
.whenComplete((mqtt5ConnAck, throwable) -> {
if (throwable != null) {
//handle failure
System.out.println("connection failure" + throwable.toString());
} else {
client.publishWith()
.topic("test")
.payload(Long.toString(System.currentTimeMillis()).getBytes())
.qos(MqttQos.EXACTLY_ONCE)
.send()
.whenComplete((mqtt5PublishResult, throwabl) -> {
if (throwabl != null) {
System.out.println("sou" + throwabl);
}
});
}
});