mqtt java broker issue [message #1111335] |
Wed, 18 September 2013 04:34 |
Jianing Ren Messages: 1 Registered: September 2013 |
Junior Member |
|
|
Hi All,
Our project is currently use java mqtt broker, the issue now was when the server-----producing application (publisher) ,publishes the message to clients. If there is certain amount of clients (around 20), the error "too many publishes in progress" will come out even I manually set the max_in_flight value to 100.
Do not if I wrote correct code on the server side.Below was the code that I publish the message from the server to the clients.
public synchronized void send(Packet packet) {
if(_mqttClient == null || _mqttClient.isConnected() == false) {
_worker.log(TAG, "Error: mqtt client offline.");
return;
}
try {
MqttTopic topic = _mqttClient.getTopic(packet.getTopicName());
String msg = packet.getMessage();
MqttMessage message = new MqttMessage(msg.getBytes());
message.setQos(2);
msg = Packet.logify(msg, packet._type, packet.getToken());
_worker.log(TAG, "<mqtt-snd topic='" + topic.getName() + "'>" + msg + "</mqtt-snd>");
topic.publish(message);
/*MqttDeliveryToken resp = */
/*resp.waitForCompletion(10000);*/
}
catch (MqttException exception) {
_worker.log(TAG, exception.getMessage());
_worker.log(TAG, "Error: mqtt send packet failed: < " + packet.getMessage() + " >");
} catch (Exception e) {
e.printStackTrace();
}
}
Thanks a lot in advance.
|
|
|
Re: mqtt java broker issue [message #1111756 is a reply to message #1111335] |
Wed, 18 September 2013 17:29 |
|
On 9/18/2013 11:12 AM, Jianing Ren wrote:
> :( Hi All,
>
>
> Our project is currently use java mqtt broker, the issue now was when
> the server-----producing application (publisher) ,publishes the message
> to clients. If there is certain amount of clients (around 20), the error
> "too many publishes in progress" will come out even I manually set the
> max_in_flight value to 100.
>
>
> Do not if I wrote correct code on the server side.Below was the code
> that I publish the message from the server to the clients.
>
> [snip]
>
> Thanks a lot in advance.
You might want to ask in a forum that supports MQTT
(http://mosquitto.org/support/ ?). This forum is for users having issues
or questions with/about Eclipse. In the way you've explained your issue
here, it is manifestly nothing to do with Eclipse.
|
|
|
Powered by
FUDForum. Page generated in 0.07392 seconds