public SubscribeHandler(final MetaMorphosisBroker broker) throws MetaClientException {
this.broker = broker;
this.slaveZooKeeper = new SlaveZooKeeper(this.broker, this);
final MetaConfig metaConfig = this.broker.getMetaConfig();
final MetaClientConfig metaClientConfig = new MetaClientConfig();
metaClientConfig.setZkConfig(metaConfig.getZkConfig());
this.sessionFactory = SlaveMetaMessageSessionFactory.create(metaClientConfig, metaConfig.getBrokerId());
this.slaveOffsetStorage =
new SlaveOffsetStorage(this.broker, this.slaveZooKeeper, this.sessionFactory.getRemotingClient());
this.messageListener =
new MetaSlaveListener(this.broker.getBrokerZooKeeper(), this.broker.getStoreManager(),
new SlaveStatsManager(this.broker.getStatsManager()));