use of com.alibaba.rsocket.route.RSocketFilter in project alibaba-rsocket-broker by alibaba.
the class RSocketBrokerManagerGossipImpl method onCloudEvent.
public void onCloudEvent(CloudEventImpl<?> cloudEvent) {
String type = cloudEvent.getAttributes().getType();
Optional<?> cloudEventData = cloudEvent.getData();
cloudEventData.ifPresent(data -> {
if (RSocketFilterEnableEvent.class.getCanonicalName().equals(type)) {
try {
RSocketFilterEnableEvent filterEnableEvent = (RSocketFilterEnableEvent) data;
RSocketFilter rsocketFilter = (RSocketFilter) applicationContext.getBean(Class.forName(filterEnableEvent.getFilterClassName()));
rsocketFilter.setEnabled(filterEnableEvent.isEnabled());
} catch (Exception ignore) {
}
}
});
}
Aggregations