Search in sources :

Example 1 with DeleteSubscriptionGroupRequestHeader

use of org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class MQClientAPIImpl method deleteSubscriptionGroup.

public void deleteSubscriptionGroup(final String addr, final String groupName, final long timeoutMillis) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
    DeleteSubscriptionGroupRequestHeader requestHeader = new DeleteSubscriptionGroupRequestHeader();
    requestHeader.setGroupName(groupName);
    RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.DELETE_SUBSCRIPTIONGROUP, requestHeader);
    RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr), request, timeoutMillis);
    assert response != null;
    switch(response.getCode()) {
        case ResponseCode.SUCCESS:
            {
                return;
            }
        default:
            break;
    }
    throw new MQClientException(response.getCode(), response.getRemark());
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) DeleteSubscriptionGroupRequestHeader(org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader) MQClientException(org.apache.rocketmq.client.exception.MQClientException)

Example 2 with DeleteSubscriptionGroupRequestHeader

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

the class MQClientAPIImpl method deleteSubscriptionGroup.

public void deleteSubscriptionGroup(final String addr, final String groupName, final long timeoutMillis) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
    DeleteSubscriptionGroupRequestHeader requestHeader = new DeleteSubscriptionGroupRequestHeader();
    requestHeader.setGroupName(groupName);
    RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.DELETE_SUBSCRIPTIONGROUP, requestHeader);
    RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr), request, timeoutMillis);
    assert response != null;
    switch(response.getCode()) {
        case ResponseCode.SUCCESS:
            {
                return;
            }
        default:
            break;
    }
    throw new MQClientException(response.getCode(), response.getRemark());
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) DeleteSubscriptionGroupRequestHeader(org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader) MQClientException(org.apache.rocketmq.client.exception.MQClientException)

Example 3 with DeleteSubscriptionGroupRequestHeader

use of org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class AdminBrokerProcessor method deleteSubscriptionGroup.

private RemotingCommand deleteSubscriptionGroup(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);
    DeleteSubscriptionGroupRequestHeader requestHeader = (DeleteSubscriptionGroupRequestHeader) request.decodeCommandCustomHeader(DeleteSubscriptionGroupRequestHeader.class);
    log.info("deleteSubscriptionGroup called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
    this.brokerController.getSubscriptionGroupManager().deleteSubscriptionGroupConfig(requestHeader.getGroupName());
    response.setCode(ResponseCode.SUCCESS);
    response.setRemark(null);
    return response;
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) DeleteSubscriptionGroupRequestHeader(org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader)

Example 4 with DeleteSubscriptionGroupRequestHeader

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

the class AdminBrokerProcessor method deleteSubscriptionGroup.

private RemotingCommand deleteSubscriptionGroup(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);
    DeleteSubscriptionGroupRequestHeader requestHeader = (DeleteSubscriptionGroupRequestHeader) request.decodeCommandCustomHeader(DeleteSubscriptionGroupRequestHeader.class);
    log.info("deleteSubscriptionGroup called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
    this.brokerController.getSubscriptionGroupManager().deleteSubscriptionGroupConfig(requestHeader.getGroupName());
    response.setCode(ResponseCode.SUCCESS);
    response.setRemark(null);
    return response;
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) DeleteSubscriptionGroupRequestHeader(org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader)

Aggregations

DeleteSubscriptionGroupRequestHeader (org.apache.rocketmq.common.protocol.header.DeleteSubscriptionGroupRequestHeader)4 RemotingCommand (org.apache.rocketmq.remoting.protocol.RemotingCommand)4 MQClientException (org.apache.rocketmq.client.exception.MQClientException)2