com.alibaba.rocketmq.common.protocol.body.SubscriptionGroupWrapper Java Examples
The following examples show how to use
com.alibaba.rocketmq.common.protocol.body.SubscriptionGroupWrapper.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SlaveSynchronize.java From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 | 6 votes |
private void syncSubscriptionGroupConfig() { String masterAddrBak = this.masterAddr; if (masterAddrBak != null) { try { SubscriptionGroupWrapper subscriptionWrapper = this.brokerController.getBrokerOuterAPI() .getAllSubscriptionGroupConfig(masterAddrBak); if (!this.brokerController.getSubscriptionGroupManager().getDataVersion() .equals(subscriptionWrapper.getDataVersion())) { SubscriptionGroupManager subscriptionGroupManager = this.brokerController.getSubscriptionGroupManager(); subscriptionGroupManager.getDataVersion().assignNewOne( subscriptionWrapper.getDataVersion()); subscriptionGroupManager.getSubscriptionGroupTable().clear(); subscriptionGroupManager.getSubscriptionGroupTable().putAll( subscriptionWrapper.getSubscriptionGroupTable()); subscriptionGroupManager.persist(); log.info("update slave Subscription Group from master, {}", masterAddrBak); } } catch (Exception e) { log.error("syncSubscriptionGroup Exception, " + masterAddrBak, e); } } }
Example #2
Source File: SlaveSynchronize.java From rocketmq with Apache License 2.0 | 6 votes |
private void syncSubscriptionGroupConfig() { String masterAddrBak = this.masterAddr; if (masterAddrBak != null) { try { SubscriptionGroupWrapper subscriptionWrapper = this.brokerController.getBrokerOuterAPI() .getAllSubscriptionGroupConfig(masterAddrBak); if (!this.brokerController.getSubscriptionGroupManager().getDataVersion() .equals(subscriptionWrapper.getDataVersion())) { SubscriptionGroupManager subscriptionGroupManager = this.brokerController.getSubscriptionGroupManager(); subscriptionGroupManager.getDataVersion().assignNewOne( subscriptionWrapper.getDataVersion()); subscriptionGroupManager.getSubscriptionGroupTable().clear(); subscriptionGroupManager.getSubscriptionGroupTable().putAll( subscriptionWrapper.getSubscriptionGroupTable()); subscriptionGroupManager.persist(); log.info("update slave Subscription Group from master, {}", masterAddrBak); } } catch (Exception e) { log.error("syncSubscriptionGroup Exception, " + masterAddrBak, e); } } }
Example #3
Source File: SlaveSynchronize.java From RocketMQ-Master-analyze with Apache License 2.0 | 6 votes |
private void syncSubscriptionGroupConfig() { String masterAddrBak = this.masterAddr; if (masterAddrBak != null) { try { SubscriptionGroupWrapper subscriptionWrapper = this.brokerController.getBrokerOuterAPI() .getAllSubscriptionGroupConfig(masterAddrBak); if (!this.brokerController.getSubscriptionGroupManager().getDataVersion() .equals(subscriptionWrapper.getDataVersion())) { SubscriptionGroupManager subscriptionGroupManager = this.brokerController.getSubscriptionGroupManager(); subscriptionGroupManager.getDataVersion() .assignNewOne(subscriptionWrapper.getDataVersion()); subscriptionGroupManager.getSubscriptionGroupTable().clear(); subscriptionGroupManager.getSubscriptionGroupTable() .putAll(subscriptionWrapper.getSubscriptionGroupTable()); subscriptionGroupManager.persist(); log.info("update slave Subscription Group from master, {}", masterAddrBak); } } catch (Exception e) { log.error("syncSubscriptionGroup Exception, " + masterAddrBak, e); } } }
Example #4
Source File: MQAdminExtImpl.java From rocket-console with Apache License 2.0 | 4 votes |
@Override //todo 可以使用这个更加细化组管理 public SubscriptionGroupWrapper getAllSubscriptionGroup(String brokerAddr, long timeoutMillis) throws InterruptedException, RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException, MQBrokerException { return MQAdminInstance.threadLocalMQAdminExt().getAllSubscriptionGroup(brokerAddr,timeoutMillis); }