|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
public interface MessageSessionFactory
消息会话工厂,meta客户端的主接口,推荐一个应用只使用一个MessageSessionFactory
方法摘要 | |
---|---|
MessageConsumer |
createConsumer(ConsumerConfig consumerConfig)
创建消息消费者,默认将offset存储在zk |
MessageConsumer |
createConsumer(ConsumerConfig consumerConfig,
OffsetStorage offsetStorage)
创建消息消费者,使用指定的offset存储器 |
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. |
List<Partition> |
getPartitionsForTopic(String topic)
Get partitions list for topic |
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. |
void |
shutdown()
关闭工厂 |
方法详细信息 |
---|
void shutdown() throws MetaClientException
Shutdownable
中的 shutdown
MetaClientException
MessageProducer createProducer(PartitionSelector partitionSelector)
partitionSelector
- 分区选择器
MessageProducer createProducer()
@Deprecated MessageProducer createProducer(boolean ordered)
ordered
- 是否有序,true为有序,如果有序,则消息按照发送顺序保存在MQ server
@Deprecated MessageProducer createProducer(PartitionSelector partitionSelector, boolean ordered)
partitionSelector
- 分区选择器ordered
- 是否有序,true为有序,如果有序,则消息按照发送顺序保存在MQ server
MessageConsumer createConsumer(ConsumerConfig consumerConfig)
consumerConfig
- 消费者配置
Map<InetSocketAddress,StatsResult> getStats() throws InterruptedException
InterruptedException
Map<InetSocketAddress,StatsResult> getStats(String item) throws InterruptedException
item
- stats item,could be "topics","realtime","offsets" or a special
topic
InterruptedException
StatsResult getStats(InetSocketAddress target) throws InterruptedException
target
- stats broker
InterruptedException
StatsResult getStats(InetSocketAddress target, String item) throws InterruptedException
target
- stats brokeritem
- stats item,could be "topics","realtime","offsets" or a special
topic
InterruptedException
MessageConsumer createConsumer(ConsumerConfig consumerConfig, OffsetStorage offsetStorage)
consumerConfig
- 消费者配置offsetStorage
- offset存储器
List<Partition> getPartitionsForTopic(String topic)
topic
-
TopicBrowser createTopicBrowser(String topic, int maxSize, long timeout, TimeUnit timeUnit)
topic
- the topicmaxSize
- fetch batch size in bytes.timeout
- timeout value to fetch messages.timeUnit
- timeout value unit.
TopicBrowser createTopicBrowser(String topic)
topic
- the topic
createTopicBrowser(String, int, long, TimeUnit)
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |