cbornet commented on a change in pull request #6720:
URL: https://github.com/apache/pulsar/pull/6720#discussion_r524915605



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java
##########
@@ -218,24 +205,20 @@ public boolean readCompacted() {
      *
      * @return a SendMessageInfo object that contains the detail of what was 
sent to consumer
      */
-
-    public ChannelPromise sendMessages(final List<Entry> entries, 
EntryBatchSizes batchSizes, EntryBatchIndexesAcks batchIndexesAcks,
+    public Future<Void> sendMessages(final List<Entry> entries, 
EntryBatchSizes batchSizes, EntryBatchIndexesAcks batchIndexesAcks,
                int totalMessages, long totalBytes, long totalChunkedMessages, 
RedeliveryTracker redeliveryTracker) {
         this.lastConsumedTimestamp = System.currentTimeMillis();
-        final ChannelHandlerContext ctx = cnx.ctx();
-        final ChannelPromise writePromise = ctx.newPromise();
 
         if (entries.isEmpty() || totalMessages == 0) {
             if (log.isDebugEnabled()) {
                 log.debug("[{}-{}] List of messages is empty, triggering write 
future immediately for consumerId {}",
                         topicName, subscription, consumerId);
             }
-            writePromise.setSuccess();
             batchSizes.recyle();
             if (batchIndexesAcks != null) {
                 batchIndexesAcks.recycle();
             }
-            return writePromise;
+            return ImmediateEventExecutor.INSTANCE.newSucceededFuture(null);

Review comment:
       I can move this part of code to the cnx delegate if you prefer (so there 
won't be any change for the regular ServerCnx/PulsarCommandSenderImpl).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to