• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SubscriptionGroupConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig的典型用法代码示例。如果您正苦于以下问题:Java SubscriptionGroupConfig类的具体用法?Java SubscriptionGroupConfig怎么用?Java SubscriptionGroupConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SubscriptionGroupConfig类属于com.alibaba.rocketmq.common.subscription包,在下文中一共展示了SubscriptionGroupConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void createSubscriptionGroup(final String addr, final SubscriptionGroupConfig config, final long timeoutMillis)
        throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
    RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.UPDATE_AND_CREATE_SUBSCRIPTIONGROUP, null);

    byte[] body = RemotingSerializable.encode(config);
    request.setBody(body);

    RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
    assert response != null;
    switch (response.getCode()) {
    case ResponseCode.SUCCESS: {
        return;
    }
    default:
        break;
    }

    throw new MQClientException(response.getCode(), response.getRemark());

}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:21,代码来源:MQClientAPIImpl.java


示例2: examineSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
@Override
public SubscriptionGroupConfig examineSubscriptionGroupConfig(String addr, String group) {
    RemotingClient remotingClient = MQAdminInstance.threadLocalRemotingClient();
    RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_ALL_SUBSCRIPTIONGROUP_CONFIG, null);
    RemotingCommand response = null;
    try {
        response = remotingClient.invokeSync(addr, request, 3000);
    } catch (Exception err) {
        throw Throwables.propagate(err);
    }
    assert response != null;
    switch (response.getCode()) {
        case ResponseCode.SUCCESS: {
            SubscriptionGroupWrapper subscriptionGroupWrapper = SubscriptionGroupWrapper.decode(response.getBody(), SubscriptionGroupWrapper.class);
            return subscriptionGroupWrapper.getSubscriptionGroupTable().get(group);
        }
        default:
            throw Throwables.propagate(new MQBrokerException(response.getCode(), response.getRemark()));
    }
}
 
开发者ID:didapinchegit,项目名称:rocket-console,代码行数:21,代码来源:MQAdminExtImpl.java


示例3: examineSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
@Override
@MultiMQAdminCmdMethod
public List<ConsumerConfigInfo> examineSubscriptionGroupConfig(String group) {
    List<ConsumerConfigInfo> consumerConfigInfoList = Lists.newArrayList();
    try {
        ClusterInfo clusterInfo = mqAdminExt.examineBrokerClusterInfo();
        for (String brokerName : fetchBrokerNameSetBySubscriptionGroup(group)) {
            String brokerAddress =  clusterInfo.getBrokerAddrTable().get(brokerName).selectBrokerAddr();
            SubscriptionGroupConfig subscriptionGroupConfig = mqAdminExt.examineSubscriptionGroupConfig(brokerAddress,group);
            consumerConfigInfoList.add(new ConsumerConfigInfo(Lists.newArrayList(brokerName),subscriptionGroupConfig));
        }
    } catch (Exception e) {
        throw propagate(e);
    }
    return consumerConfigInfoList;
}
 
开发者ID:didapinchegit,项目名称:rocket-console,代码行数:17,代码来源:ConsumerServiceImpl.java


示例4: createSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void createSubscriptionGroup(final String addr, final SubscriptionGroupConfig config, final long timeoutMillis)
        throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
    RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.UPDATE_AND_CREATE_SUBSCRIPTIONGROUP, null);

    byte[] body = RemotingSerializable.encode(config);
    request.setBody(body);

    RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
    assert response != null;
    switch (response.getCode()) {
        case ResponseCode.SUCCESS: {
            return;
        }
        default:
            break;
    }

    throw new MQClientException(response.getCode(), response.getRemark());

}
 
开发者ID:medusar,项目名称:rocketmq-commet,代码行数:21,代码来源:MQClientAPIImpl.java


示例5: updateAndCreateSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
private RemotingCommand updateAndCreateSubscriptionGroup(ChannelHandlerContext ctx,
        RemotingCommand request) throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);

    log.info("updateAndCreateSubscriptionGroup called by {}",
        RemotingHelper.parseChannelRemoteAddr(ctx.channel()));

    SubscriptionGroupConfig config =
            RemotingSerializable.decode(request.getBody(), SubscriptionGroupConfig.class);
    if (config != null) {
        this.brokerController.getSubscriptionGroupManager().updateSubscriptionGroupConfig(config);
    }

    response.setCode(ResponseCode.SUCCESS);
    response.setRemark(null);
    return response;
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:18,代码来源:AdminBrokerProcessor.java


示例6: updateAndCreateSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
private RemotingCommand updateAndCreateSubscriptionGroup(ChannelHandlerContext ctx,
        RemotingCommand request) throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);

    log.info("updateAndCreateSubscriptionGroup called by {}",
        RemotingHelper.parseChannelRemoteAddr(ctx.channel()));

    SubscriptionGroupConfig config =
            RemotingSerializable.decode(request.getBody(), SubscriptionGroupConfig.class);
    if (config != null) {
        this.brokerController.getSubscriptionGroupManager().updateSubscriptionGroupConfig(config);
    }

    response.setCode(ResponseCode.SUCCESS_VALUE);
    response.setRemark(null);
    return response;
}
 
开发者ID:brucechan0921,项目名称:RocketMQ-3.0.8,代码行数:18,代码来源:AdminBrokerProcessor.java


示例7: updateSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void updateSubscriptionGroupConfig(final SubscriptionGroupConfig config) {
    SubscriptionGroupConfig old = this.subscriptionGroupTable.put(config.getGroupName(), config);
    if (old != null) {
        log.info("update subscription group config, old: " + old + " new: " + config);
    }
    else {
        log.info("create new subscription group, " + config);
    }

    this.dataVersion.nextVersion();

    this.persist();
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:14,代码来源:SubscriptionGroupManager.java


示例8: printLoadDataWhenFirstBoot

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
private void printLoadDataWhenFirstBoot(final SubscriptionGroupManager sgm) {
    Iterator<Entry<String, SubscriptionGroupConfig>> it = sgm.getSubscriptionGroupTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<String, SubscriptionGroupConfig> next = it.next();
        log.info("load exist subscription group, {}", next.getValue().toString());
    }
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:8,代码来源:SubscriptionGroupManager.java


示例9: deleteSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void deleteSubscriptionGroupConfig(final String groupName) {
    SubscriptionGroupConfig old = this.subscriptionGroupTable.remove(groupName);
    if (old != null) {
        log.info("delete subscription group OK, subscription group: " + old);
        this.dataVersion.nextVersion();
        this.persist();
    }
    else {
        log.warn("delete subscription group failed, subscription group: " + old + " not exist");
    }
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:12,代码来源:SubscriptionGroupManager.java


示例10: updateAndCreateSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
private RemotingCommand updateAndCreateSubscriptionGroup(ChannelHandlerContext ctx, RemotingCommand request)
        throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);

    log.info("updateAndCreateSubscriptionGroup called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()));

    SubscriptionGroupConfig config = RemotingSerializable.decode(request.getBody(), SubscriptionGroupConfig.class);
    if (config != null) {
        this.brokerController.getSubscriptionGroupManager().updateSubscriptionGroupConfig(config);
    }

    response.setCode(ResponseCode.SUCCESS);
    response.setRemark(null);
    return response;
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:16,代码来源:AdminBrokerProcessor.java


示例11: createSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void createSubscriptionGroup(final String addr, final SubscriptionGroupConfig config,
        final long timeoutMillis) throws RemotingException, MQBrokerException, InterruptedException,
        MQClientException {
    // 添加虚拟运行环境相关的projectGroupPrefix
    if (!UtilAll.isBlank(projectGroupPrefix)) {
        config.setGroupName(VirtualEnvUtil.buildWithProjectGroup(config.getGroupName(),
            projectGroupPrefix));
    }

    RemotingCommand request =
            RemotingCommand.createRequestCommand(RequestCode.UPDATE_AND_CREATE_SUBSCRIPTIONGROUP, null);

    byte[] body = RemotingSerializable.encode(config);
    request.setBody(body);

    RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
    assert response != null;
    switch (response.getCode()) {
    case ResponseCode.SUCCESS: {
        return;
    }
    default:
        break;
    }

    throw new MQClientException(response.getCode(), response.getRemark());

}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:29,代码来源:MQClientAPIImpl.java


示例12: printLoadDataWhenFirstBoot

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
private void printLoadDataWhenFirstBoot(final SubscriptionGroupManager sgm) {
    Iterator<Entry<String, SubscriptionGroupConfig>> it =
            sgm.getSubscriptionGroupTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<String, SubscriptionGroupConfig> next = it.next();
        log.info("load exist subscription group, {}", next.getValue().toString());
    }
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:9,代码来源:SubscriptionGroupManager.java


示例13: createSubscriptionGroup

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void createSubscriptionGroup(final String addr, final SubscriptionGroupConfig config,
        final long timeoutMillis) throws RemotingException, MQBrokerException, InterruptedException,
        MQClientException {
    // 添加虚拟运行环境相关的projectGroupPrefix
    if (!UtilAll.isBlank(projectGroupPrefix)) {
        config.setGroupName(VirtualEnvUtil.buildWithProjectGroup(config.getGroupName(),
            projectGroupPrefix));
    }

    RemotingCommand request =
            RemotingCommand.createRequestCommand(MQRequestCode.UPDATE_AND_CREATE_SUBSCRIPTIONGROUP_VALUE,
                null);

    byte[] body = RemotingSerializable.encode(config);
    request.setBody(body);

    RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
    assert response != null;
    switch (response.getCode()) {
    case ResponseCode.SUCCESS_VALUE: {
        return;
    }
    default:
        break;
    }

    throw new MQClientException(response.getCode(), response.getRemark());

}
 
开发者ID:brucechan0921,项目名称:RocketMQ-3.0.8,代码行数:30,代码来源:MQClientAPIImpl.java


示例14: createAndUpdateSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
@Override
public void createAndUpdateSubscriptionGroupConfig(String addr, SubscriptionGroupConfig config) throws RemotingException,
        MQBrokerException, InterruptedException, MQClientException {
    defaultMQAdminExtImpl.createAndUpdateSubscriptionGroupConfig(addr, config);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:6,代码来源:DefaultMQAdminExt.java


示例15: examineSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
@Override
public SubscriptionGroupConfig examineSubscriptionGroupConfig(String addr, String group) {
    return defaultMQAdminExtImpl.examineSubscriptionGroupConfig(addr, group);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:5,代码来源:DefaultMQAdminExt.java


示例16: createAndUpdateSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
@Override
public void createAndUpdateSubscriptionGroupConfig(String addr, SubscriptionGroupConfig config) throws RemotingException,
        MQBrokerException, InterruptedException, MQClientException {
    this.mqClientInstance.getMQClientAPIImpl().createSubscriptionGroup(addr, config, timeoutMillis);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:6,代码来源:DefaultMQAdminExtImpl.java


示例17: examineSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
@Override
public SubscriptionGroupConfig examineSubscriptionGroupConfig(String addr, String group) {
    // TODO Auto-generated method stub
    return null;
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:6,代码来源:DefaultMQAdminExtImpl.java


示例18: createAndUpdateSubscriptionGroupConfig

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
void createAndUpdateSubscriptionGroupConfig(final String addr, final SubscriptionGroupConfig config) throws RemotingException,
MQBrokerException, InterruptedException, MQClientException;
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:3,代码来源:MQAdminExt.java


示例19: getSubscriptionGroupTable

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public ConcurrentHashMap<String, SubscriptionGroupConfig> getSubscriptionGroupTable() {
    return subscriptionGroupTable;
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:4,代码来源:SubscriptionGroupManager.java


示例20: setSubscriptionGroupTable

import com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig; //导入依赖的package包/类
public void setSubscriptionGroupTable(
        ConcurrentHashMap<String, SubscriptionGroupConfig> subscriptionGroupTable) {
    this.subscriptionGroupTable = subscriptionGroupTable;
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:5,代码来源:SubscriptionGroupWrapper.java



注:本文中的com.alibaba.rocketmq.common.subscription.SubscriptionGroupConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InstantiationUtil类代码示例发布时间:2022-05-23
下一篇:
Java PlotCommitList类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap