com.taobao.metamorphosis.tools.monitor.core
类 MsgReceiver
java.lang.Object
com.taobao.metamorphosis.tools.monitor.core.MsgReceiver
public class MsgReceiver
- extends Object
代表直连一台broker的消息接收者
- 从以下版本开始:
- 2011-5-24 上午11:35:48
- 作者:
- 无花
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MsgReceiver
public MsgReceiver(String serverUrl,
MonitorConfig monitorConfig)
throws MetaClientException
- 抛出:
MetaClientException
get
public ReveiceResult get(String topic,
Partition partition)
同步的方式接收消息.
期望从partition尾部开始接收(需要把接收的offset设置为上一次成功发送消息后的offset)
异常处理:这里捕获所有异常(Error除外),装入result的形式返回
setOffset
public void setOffset(Partition partition,
long offset)
getOffset
public long getOffset(Partition partition)
dispose
public void dispose()
Copyright © 2010–2013. All rights reserved.