Skip to content

Commit

Permalink
Fixed mem leak when acknowledging while disconnected from broker (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored and Jai Asher committed May 20, 2018
1 parent 0093a80 commit b3d5256
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,13 @@ protected CompletableFuture<Void> doAcknowledge(MessageId messageId, AckType ack
private CompletableFuture<Void> sendAcknowledge(MessageId messageId, AckType ackType,
Map<String,Long> properties) {
MessageIdImpl msgId = (MessageIdImpl) messageId;
final ByteBuf cmd = Commands.newAck(consumerId, msgId.getLedgerId(), msgId.getEntryId(),
ackType, null, properties);

// There's no actual response from ack messages
final CompletableFuture<Void> ackFuture = new CompletableFuture<Void>();

if (isConnected()) {
final ByteBuf cmd = Commands.newAck(consumerId, msgId.getLedgerId(), msgId.getEntryId(),
ackType, null, properties);
cnx().ctx().writeAndFlush(cmd).addListener(new GenericFutureListener<Future<Void>>() {
@Override
public void operationComplete(Future<Void> future) throws Exception {
Expand Down

0 comments on commit b3d5256

Please sign in to comment.