.
This commit is contained in:
parent
e8b9140103
commit
e2c2b62665
@ -298,24 +298,26 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
|
|||||||
|
|
||||||
// send msg
|
// send msg
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
String msg = null;
|
while (true) {
|
||||||
try {
|
String msg = null;
|
||||||
msg = sendMsgQueue.take();
|
|
||||||
writer.write(msg.getBytes(UTF_8));
|
|
||||||
writer.flush();
|
|
||||||
} catch (InterruptedException | IOException e) {
|
|
||||||
logger.log(Level.WARNING, "send-msg[" + msg + "] event accept error :", e);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(3000);
|
msg = sendMsgQueue.take();
|
||||||
assert msg != null;
|
|
||||||
writer.write(msg.getBytes(UTF_8));
|
writer.write(msg.getBytes(UTF_8));
|
||||||
writer.flush();
|
writer.flush();
|
||||||
} catch (IOException | InterruptedException | NullPointerException ex) {
|
} catch (InterruptedException | IOException e) {
|
||||||
e.printStackTrace();
|
logger.log(Level.WARNING, "send-msg[" + msg + "] event accept error :", e);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
assert msg != null;
|
||||||
|
writer.write(msg.getBytes(UTF_8));
|
||||||
|
writer.flush();
|
||||||
|
} catch (IOException | InterruptedException | NullPointerException ex) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user