Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » mqtt java broker issue(error "too many publishes")
icon8.gif  mqtt java broker issue [message #1111335] Wed, 18 September 2013 04:34 Go to next message
Jianing Ren is currently offline Jianing RenFriend
Messages: 1
Registered: September 2013
Junior Member
Sad
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 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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.
Previous Topic:Eclipse with Javascript - projects with existing code
Next Topic:Linking source vs. Required projects on build path vs. Project sets
Goto Forum:
  


Current Time: Tue Apr 23 15:42:44 GMT 2024

Powered by FUDForum. Page generated in 0.08623 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top