- 监听熔断事件
Object receiveEvent = new Object() {
@Subscribe
public void onEvent(CircutBreakerEvent circutBreakerEvent) {
//Get information from circutBreakerEvent
}
};
EventManager.getEventBus().register(receiveEvent);
- 监听实例隔离事件
Object receiveEvent = new Object() {
@Subscribe
public void onEvent(IsolationServerEvent isolationServerEvent) {
//Get information from isolationServerEvent
}
};
EventManager.getEventBus().register(receiveEvent);
- 两个事件均监听
Object receiveEvent = new Object() {
@Subscribe
public void onEvent(AlarmEvent alarmEvent) {
//Get information from alarmEvent
}
};
EventManager.getEventBus().register(receiveEvent);