获取熔断与实例隔离告警事件
场景描述
- 在微服务运行期间熔断或实例隔离状态发生变化时,需要监听到相关事件,获取相关信息并进行处理
使用参考
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);