| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
consumption(Event<T> event)
消费方法实现
|
boolean |
consumptionBefore(Event<T> event)
事件执行前回调
|
void |
consumptionError(Event<T> event,
Throwable e)
消费时发生异常信息处理回调
|
void |
consumptionFinally(Event<T> event)
消费方法实现方法的finally块回调
|
void |
consumptionSuccess(Event<T> event)
消费成功回调
|
void |
onEvent(Event<T> event)
不重复消费执行
|
void |
onEvent(Event<T> event,
long sequence,
boolean endOfBatch)
重复消费执行
|
public Consumer(String name)
public final void onEvent(Event<T> event, long sequence, boolean endOfBatch) throws Exception
public abstract void consumption(Event<T> event) throws Exception
event - 事件传值Exceptionpublic boolean consumptionBefore(Event<T> event) throws Exception
event - Exception - 一旦发生异常将导致不执行事件public void consumptionSuccess(Event<T> event) throws Exception
event - Exceptionpublic void consumptionError(Event<T> event, Throwable e) throws Exception
event - 事件传值ExceptionCopyright © 2019. All rights reserved.