use of org.wso2.carbon.apimgt.gateway.handlers.streaming.AsyncAnalyticsDataProvider in project carbon-apimgt by wso2.
the class AnalyticsMetricsHandler method handleResponseOutFlow.
@Override
public boolean handleResponseOutFlow(MessageContext messageContext) {
if (messageContext.getPropertyKeySet().contains(InboundWebsocketConstants.WEBSOCKET_SUBSCRIBER_PATH)) {
return true;
}
AnalyticsDataProvider provider;
Object skipPublishMetrics = messageContext.getProperty(Constants.SKIP_DEFAULT_METRICS_PUBLISHING);
if (skipPublishMetrics != null && (Boolean) skipPublishMetrics) {
provider = new AsyncAnalyticsDataProvider(messageContext);
} else {
provider = new SynapseAnalyticsDataProvider(messageContext);
}
GenericRequestDataCollector dataCollector = new GenericRequestDataCollector(provider);
try {
dataCollector.collectData();
} catch (Exception e) {
log.error("Error Occurred when collecting data", e);
}
return true;
}
Aggregations