Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Request for consideration

Wouldn't it be more effective to apply back pressure to the client rather than disconnect it? In other words, just don't read the PUBLISH from TCP until the message queue is less full?


On 29 October 2013 21:29, Marc L Cohen <mlcohen@xxxxxxxxxx> wrote:

We have someone doing some testing that is having a problem with the Java client. The situation is this, the server is designed to queue up to a set maximum of messages. If a publisher tries to publish a message while this maximum is filled, the server closes the connection. The testcase gets to this point, and when it receives an Exception from the publish it tries to reconnect to the server. Sometimes this reconnection fails with "Client is currently disconnecting (32102)".
It does eventually clear up the connection and reallow a new connection, but this can take a while, up to the KeepAliveInterval. What is happening is that in CommsSender.stop:

if (!Thread.currentThread().equals(sendThread)) {
try {
// first notify get routine to finish
// Wait for the thread to finish.
catch (InterruptedException ex) {

It is the sendThread.join() that is taking the time. Is there any reason you can't add a sendThread.interrupt(); before the join to interrupt the wait?

Marc L. Cohen
MessageSight Test/Development
also at:teddybbear@xxxxxxx
(512) 286-5744 (T/L 363-5744)
FAX (512) 973-4293

paho-dev mailing list

Paul Fremantle
Part-time PhD student - School of Computing
twitter: pzfreo / skype: paulfremantle / blog:
CTO and Co-Founder, WSO2
OASIS WS-RX TC Co-chair, Apache Member
07740 199 729

Back to the top