com.taobao.metamorphosis.client.consumer
接口 InnerConsumer

所有已知实现类:
SimpleMessageConsumer

public interface InnerConsumer

不对外提供的consumer接口,用于提供给Fetch使用

作者:
boyan(boyan@taobao.com)

方法摘要
 void appendCouldNotProcessMessage(Message message)
          处理无法被客户端消费的消息
 MessageIterator fetch(FetchRequest fetchRequest, long timeout, TimeUnit timeUnit)
          抓取消息
 ConsumerConfig getConsumerConfig()
           
 ConsumerMessageFilter getMessageFilter(String topic)
           
 MessageListener getMessageListener(String topic)
          返回topic对应的消息监听器
 long offset(FetchRequest fetchRequest)
          查询offset
 

方法详细信息

fetch

MessageIterator fetch(FetchRequest fetchRequest,
                      long timeout,
                      TimeUnit timeUnit)
                      throws MetaClientException,
                             InterruptedException
抓取消息

参数:
fetchRequest -
timeout -
timeUnit -
返回:
抛出:
MetaClientException
InterruptedException

getMessageListener

MessageListener getMessageListener(String topic)
返回topic对应的消息监听器

参数:
topic -
返回:

getMessageFilter

ConsumerMessageFilter getMessageFilter(String topic)

getConsumerConfig

ConsumerConfig getConsumerConfig()

appendCouldNotProcessMessage

void appendCouldNotProcessMessage(Message message)
                                  throws IOException
处理无法被客户端消费的消息

参数:
message -
抛出:
IOException

offset

long offset(FetchRequest fetchRequest)
            throws MetaClientException
查询offset

参数:
fetchRequest -
返回:
抛出:
MetaClientException


Copyright © 2010–2013. All rights reserved.