|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.taobao.metamorphosis.client.MetaMessageSessionFactory
public class MetaMessageSessionFactory
消息会话工厂,配置的优先级,优先使用传入的MetaClientConfig中的配置项, 其次使用MetaClientConfig中的zkConfig配置的zk中的选项,如果都没有,则从diamond获取zk地址来获取配置项
字段摘要 | |
---|---|
static long |
MAX_SCHEDULE_WRITTEN_BYTES
|
protected MetaZookeeper |
metaZookeeper
|
protected ProducerZooKeeper |
producerZooKeeper
|
protected RemotingClientWrapper |
remotingClient
|
protected IdGenerator |
sessionIdGenerator
|
static boolean |
TCP_NO_DELAY
|
构造方法摘要 | |
---|---|
MetaMessageSessionFactory(MetaClientConfig metaClientConfig)
|
方法摘要 | ||
---|---|---|
protected
|
addChild(T child)
|
|
protected void |
checkConsumerConfig(ConsumerConfig consumerConfig)
|
|
MessageConsumer |
createConsumer(ConsumerConfig consumerConfig)
创建消息消费者,默认将offset存储在zk |
|
MessageConsumer |
createConsumer(ConsumerConfig consumerConfig,
OffsetStorage offsetStorage)
创建消息消费者,使用指定的offset存储器 |
|
protected MessageConsumer |
createConsumer(ConsumerConfig consumerConfig,
OffsetStorage offsetStorage,
RecoverManager recoverManager0)
|
|
protected LoadBalanceStrategy |
createLoadBalanceStrategy(ConsumerConfig consumerConfig)
|
|
MessageProducer |
createProducer()
创建消息生产者,默认使用轮询分区选择器 |
|
MessageProducer |
createProducer(boolean ordered)
已过时。 |
|
MessageProducer |
createProducer(PartitionSelector partitionSelector)
创建消息生产者 |
|
MessageProducer |
createProducer(PartitionSelector partitionSelector,
boolean ordered)
已过时。 |
|
TopicBrowser |
createTopicBrowser(String topic)
Returns a topic browser to iterate all messages under the topic from all alive brokers. |
|
TopicBrowser |
createTopicBrowser(String topic,
int maxSize,
long timeout,
TimeUnit timeUnit)
Returns a topic browser to iterate all messages under the topic from all alive brokers. |
|
CopyOnWriteArrayList<Shutdownable> |
getChildren()
返回此工厂创建的所有子对象,如生产者、消费者等 |
|
ConsumerZooKeeper |
getConsumerZooKeeper()
返回消费者和zk交互管理器 |
|
MetaClientConfig |
getMetaClientConfig()
返回客户端配置 |
|
List<Partition> |
getPartitionsForTopic(String topic)
Get partitions list for topic |
|
ProducerZooKeeper |
getProducerZooKeeper()
返回生产者和zk交互管理器 |
|
RecoverManager |
getRecoverStorageManager()
返回本地恢复消息管理器 |
|
RemotingClientWrapper |
getRemotingClient()
返回通讯客户端 |
|
Map<InetSocketAddress,StatsResult> |
getStats()
Get statistics information from all brokers in this session factory. |
|
StatsResult |
getStats(InetSocketAddress target)
Get statistics information from special broker.If the broker is not connected in this session factory,it will return null. |
|
StatsResult |
getStats(InetSocketAddress target,
String item)
Get item statistics information from special broker.If the broker is not connected in this session factory,it will return null. |
|
Map<InetSocketAddress,StatsResult> |
getStats(String item)
Get item statistics information from all brokers in this session factory. |
|
SubscribeInfoManager |
getSubscribeInfoManager()
返回订阅关系管理器 |
|
protected ConsumerZooKeeper |
initConsumerZooKeeper(RemotingClientWrapper remotingClientWrapper,
org.I0Itec.zkclient.ZkClient zkClient2,
ZkUtils.ZKConfig config)
|
|
|
removeChild(T child)
删除子会话 |
|
void |
shutdown()
关闭工厂 |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
protected RemotingClientWrapper remotingClient
protected final ProducerZooKeeper producerZooKeeper
protected final IdGenerator sessionIdGenerator
protected MetaZookeeper metaZookeeper
public static final boolean TCP_NO_DELAY
public static final long MAX_SCHEDULE_WRITTEN_BYTES
构造方法详细信息 |
---|
public MetaMessageSessionFactory(MetaClientConfig metaClientConfig) throws MetaClientException
MetaClientException
方法详细信息 |
---|
public RemotingClientWrapper getRemotingClient()
public SubscribeInfoManager getSubscribeInfoManager()
public MetaClientConfig getMetaClientConfig()
public ProducerZooKeeper getProducerZooKeeper()
public ConsumerZooKeeper getConsumerZooKeeper()
public RecoverManager getRecoverStorageManager()
public CopyOnWriteArrayList<Shutdownable> getChildren()
protected ConsumerZooKeeper initConsumerZooKeeper(RemotingClientWrapper remotingClientWrapper, org.I0Itec.zkclient.ZkClient zkClient2, ZkUtils.ZKConfig config)
public void shutdown() throws MetaClientException
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 shutdown
Shutdownable
中的 shutdown
MetaClientException
public MessageProducer createProducer(PartitionSelector partitionSelector)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createProducer
partitionSelector
- 分区选择器
public MessageProducer createProducer()
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createProducer
@Deprecated public MessageProducer createProducer(boolean ordered)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createProducer
ordered
- 是否有序,true为有序,如果有序,则消息按照发送顺序保存在MQ server
@Deprecated public MessageProducer createProducer(PartitionSelector partitionSelector, boolean ordered)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createProducer
partitionSelector
- 分区选择器ordered
- 是否有序,true为有序,如果有序,则消息按照发送顺序保存在MQ server
protected <T extends Shutdownable> T addChild(T child)
public <T extends Shutdownable> void removeChild(T child)
T
- child
- protected LoadBalanceStrategy createLoadBalanceStrategy(ConsumerConfig consumerConfig)
protected MessageConsumer createConsumer(ConsumerConfig consumerConfig, OffsetStorage offsetStorage, RecoverManager recoverManager0)
public MessageConsumer createConsumer(ConsumerConfig consumerConfig, OffsetStorage offsetStorage)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createConsumer
consumerConfig
- 消费者配置offsetStorage
- offset存储器
public Map<InetSocketAddress,StatsResult> getStats(String item) throws InterruptedException
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 getStats
item
- stats item,could be "topics","realtime","offsets" or a special
topic
InterruptedException
public Map<InetSocketAddress,StatsResult> getStats() throws InterruptedException
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 getStats
InterruptedException
public StatsResult getStats(InetSocketAddress target, String item) throws InterruptedException
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 getStats
target
- stats brokeritem
- stats item,could be "topics","realtime","offsets" or a special
topic
InterruptedException
public StatsResult getStats(InetSocketAddress target) throws InterruptedException
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 getStats
target
- stats broker
InterruptedException
public List<Partition> getPartitionsForTopic(String topic)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 getPartitionsForTopic
public MessageConsumer createConsumer(ConsumerConfig consumerConfig)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createConsumer
consumerConfig
- 消费者配置
protected void checkConsumerConfig(ConsumerConfig consumerConfig)
public TopicBrowser createTopicBrowser(String topic)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createTopicBrowser
topic
- the topic
MessageSessionFactory.createTopicBrowser(String, int, long, TimeUnit)
public TopicBrowser createTopicBrowser(String topic, int maxSize, long timeout, TimeUnit timeUnit)
MessageSessionFactory
复制的描述
MessageSessionFactory
中的 createTopicBrowser
topic
- the topicmaxSize
- fetch batch size in bytes.timeout
- timeout value to fetch messages.timeUnit
- timeout value unit.
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |