Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,39 @@ public void sendPartitionMetadataResponse(ServerError error, String errorMsg, lo
BaseCommand command = Commands.newPartitionMetadataResponseCommand(error, errorMsg, requestId);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendPartitionMetadataResponse(int partitions, long requestId) {
BaseCommand command = Commands.newPartitionMetadataResponseCommand(partitions, requestId);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendSuccessResponse(long requestId) {
BaseCommand command = Commands.newSuccessCommand(requestId);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendErrorResponse(long requestId, ServerError error, String message) {
BaseCommand command = Commands.newErrorCommand(requestId, error, message);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendProducerSuccessResponse(long requestId, String producerName, SchemaVersion schemaVersion) {
BaseCommand command = Commands.newProducerSuccessCommand(requestId, producerName, schemaVersion);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -97,7 +97,7 @@ public void sendProducerSuccessResponse(long requestId, String producerName, lon
schemaVersion, topicEpoch, isProducerReady);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -107,15 +107,15 @@ public void sendSendReceiptResponse(long producerId, long sequenceId, long highe
entryId);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendSendError(long producerId, long sequenceId, ServerError error, String errorMsg) {
BaseCommand command = Commands.newSendErrorCommand(producerId, sequenceId, error, errorMsg);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -125,31 +125,31 @@ public void sendGetTopicsOfNamespaceResponse(List<String> topics, String topicsH
filtered, changed, requestId);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendGetSchemaResponse(long requestId, SchemaInfo schema, SchemaVersion version) {
BaseCommand command = Commands.newGetSchemaResponseCommand(requestId, schema, version);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendGetSchemaErrorResponse(long requestId, ServerError error, String errorMessage) {
BaseCommand command = Commands.newGetSchemaResponseErrorCommand(requestId, error, errorMessage);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendGetOrCreateSchemaResponse(long requestId, SchemaVersion schemaVersion) {
BaseCommand command = Commands.newGetOrCreateSchemaResponseCommand(requestId, schemaVersion);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -158,15 +158,15 @@ public void sendGetOrCreateSchemaErrorResponse(long requestId, ServerError error
Commands.newGetOrCreateSchemaResponseErrorCommand(requestId, error, errorMessage);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendConnectedResponse(int clientProtocolVersion, int maxMessageSize) {
BaseCommand command = Commands.newConnectedCommand(clientProtocolVersion, maxMessageSize);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -177,15 +177,15 @@ public void sendLookupResponse(String brokerServiceUrl, String brokerServiceUrlT
authoritative, response, requestId, proxyThroughServiceUrl);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
public void sendLookupResponse(ServerError error, String errorMsg, long requestId) {
BaseCommand command = Commands.newLookupErrorResponseCommand(error, errorMsg, requestId);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -201,20 +201,20 @@ public void sendActiveConsumerChange(long consumerId, boolean isActive) {

@Override
public void sendSuccess(long requestId) {
cnx.ctx().writeAndFlush(Commands.newSuccess(requestId));
cnx.ctx().writeAndFlush(Commands.newSuccess(requestId), cnx.ctx().voidPromise());
}

@Override
public void sendError(long requestId, ServerError error, String message) {
cnx.ctx().writeAndFlush(Commands.newError(requestId, error, message));
cnx.ctx().writeAndFlush(Commands.newError(requestId, error, message), cnx.ctx().voidPromise());
}

@Override
public void sendReachedEndOfTopic(long consumerId) {
// Only send notification if the client understand the command
if (cnx.getRemoteEndpointProtocolVersion() >= ProtocolVersion.v9.getValue()) {
log.info("[{}] Notifying consumer that end of topic has been reached", this);
cnx.ctx().writeAndFlush(Commands.newReachedEndOfTopic(consumerId));
cnx.ctx().writeAndFlush(Commands.newReachedEndOfTopic(consumerId), cnx.ctx().voidPromise());
}
}

Expand Down Expand Up @@ -295,7 +295,7 @@ public void sendTcClientConnectResponse(long requestId, ServerError error, Strin
BaseCommand command = Commands.newTcClientConnectResponse(requestId, error, message);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -309,7 +309,7 @@ public void sendNewTxnResponse(long requestId, TxnID txnID, long tcID) {
txnID.getMostSigBits());
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
if (this.interceptor != null) {
this.interceptor.txnOpened(tcID, txnID.toString());
}
Expand All @@ -320,7 +320,7 @@ public void sendNewTxnErrorResponse(long requestId, long txnID, ServerError erro
BaseCommand command = Commands.newTxnResponse(requestId, txnID, error, message);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
}

@Override
Expand All @@ -329,7 +329,7 @@ public void sendEndTxnResponse(long requestId, TxnID txnID, int txnAction) {
txnID.getMostSigBits());
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
if (this.interceptor != null) {
this.interceptor.txnEnded(txnID.toString(), txnAction);
}
Expand All @@ -340,7 +340,7 @@ public void sendEndTxnErrorResponse(long requestId, TxnID txnID, ServerError err
BaseCommand command = Commands.newEndTxnResponse(requestId, txnID.getMostSigBits(), error, message);
safeIntercept(command, cnx);
ByteBuf outBuf = Commands.serializeWithSize(command);
cnx.ctx().writeAndFlush(outBuf);
cnx.ctx().writeAndFlush(outBuf, cnx.ctx().voidPromise());
if (this.interceptor != null) {
this.interceptor.txnEnded(txnID.toString(), TxnAction.ABORT_VALUE);
}
Expand Down