You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2020/07/31 12:48:55 UTC

[activemq-artemis] 01/04: ARTEMIS-2844 Use writeAndFlush with voidPromise to reduce GC pressure

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 0db13ee8ab60a07aa0f90cdfcf4158d0c5b00d38
Author: Francesco Nigro <ni...@gmail.com>
AuthorDate: Sat Jul 11 09:09:11 2020 +0200

    ARTEMIS-2844 Use writeAndFlush with voidPromise to reduce GC pressure
---
 .../activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java       | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java
index 7266cd5..136ad7e 100644
--- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java
+++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java
@@ -259,8 +259,7 @@ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter {
          return;
       }
       MQTTUtil.logMessage(session.getSessionState(), message, false);
-      ctx.write(message);
-      ctx.flush();
+      ctx.writeAndFlush(message, ctx.voidPromise());
    }
 
    private int getMessageId(MqttMessage message) {