Search in sources :

Example 1 with LanguageCode

use of org.apache.rocketmq.remoting.protocol.LanguageCode in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class AdminBrokerProcessor method resetOffset.

public RemotingCommand resetOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {
    final ResetOffsetRequestHeader requestHeader = (ResetOffsetRequestHeader) request.decodeCommandCustomHeader(ResetOffsetRequestHeader.class);
    log.info("[reset-offset] reset offset started by {}. topic={}, group={}, timestamp={}, isForce={}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getTopic(), requestHeader.getGroup(), requestHeader.getTimestamp(), requestHeader.isForce());
    boolean isC = false;
    LanguageCode language = request.getLanguage();
    switch(language) {
        case CPP:
            isC = true;
            break;
    }
    return this.brokerController.getBroker2Client().resetOffset(requestHeader.getTopic(), requestHeader.getGroup(), requestHeader.getTimestamp(), requestHeader.isForce(), isC);
}
Also used : LanguageCode(org.apache.rocketmq.remoting.protocol.LanguageCode) ResetOffsetRequestHeader(org.apache.rocketmq.common.protocol.header.ResetOffsetRequestHeader)

Example 2 with LanguageCode

use of org.apache.rocketmq.remoting.protocol.LanguageCode in project rocketmq by apache.

the class AdminBrokerProcessor method resetOffset.

public RemotingCommand resetOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {
    final ResetOffsetRequestHeader requestHeader = (ResetOffsetRequestHeader) request.decodeCommandCustomHeader(ResetOffsetRequestHeader.class);
    log.info("[reset-offset] reset offset started by {}. topic={}, group={}, timestamp={}, isForce={}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getTopic(), requestHeader.getGroup(), requestHeader.getTimestamp(), requestHeader.isForce());
    boolean isC = false;
    LanguageCode language = request.getLanguage();
    switch(language) {
        case CPP:
            isC = true;
            break;
    }
    return this.brokerController.getBroker2Client().resetOffset(requestHeader.getTopic(), requestHeader.getGroup(), requestHeader.getTimestamp(), requestHeader.isForce(), isC);
}
Also used : LanguageCode(org.apache.rocketmq.remoting.protocol.LanguageCode) ResetOffsetRequestHeader(org.apache.rocketmq.common.protocol.header.ResetOffsetRequestHeader)

Aggregations

ResetOffsetRequestHeader (org.apache.rocketmq.common.protocol.header.ResetOffsetRequestHeader)2 LanguageCode (org.apache.rocketmq.remoting.protocol.LanguageCode)2