Search in sources :

Example 6 with DeleteTopicRequestHeader

use of org.apache.rocketmq.common.protocol.header.DeleteTopicRequestHeader in project rocketmq by apache.

the class AdminBrokerProcessor method deleteTopic.

private RemotingCommand deleteTopic(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);
    DeleteTopicRequestHeader requestHeader = (DeleteTopicRequestHeader) request.decodeCommandCustomHeader(DeleteTopicRequestHeader.class);
    log.info("deleteTopic called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
    this.brokerController.getTopicConfigManager().deleteTopicConfig(requestHeader.getTopic());
    this.brokerController.getMessageStore().cleanUnusedTopic(this.brokerController.getTopicConfigManager().getTopicConfigTable().keySet());
    response.setCode(ResponseCode.SUCCESS);
    response.setRemark(null);
    return response;
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) DeleteTopicRequestHeader(org.apache.rocketmq.common.protocol.header.DeleteTopicRequestHeader)

Aggregations

DeleteTopicRequestHeader (org.apache.rocketmq.common.protocol.header.DeleteTopicRequestHeader)6 RemotingCommand (org.apache.rocketmq.remoting.protocol.RemotingCommand)6 MQClientException (org.apache.rocketmq.client.exception.MQClientException)4