Search in sources :

Example 1 with FaultEvent

use of org.apache.synapse.aspects.flow.statistics.log.templates.FaultEvent in project wso2-synapse by wso2.

the class FaultStatisticCollector method reportFault.

/**
 * Enqueue Fault Event to the event queue indicating that fault has occurred in the message flow.
 *
 * @param messageContext messageContext of the message flow.
 */
public static void reportFault(MessageContext messageContext) {
    if (shouldReportStatistic(messageContext)) {
        boolean isFaultCreated = isFaultAlreadyReported(messageContext);
        if (!isFaultCreated) {
            BasicStatisticDataUnit dataUnit = new BasicStatisticDataUnit();
            dataUnit.setStatisticId(StatisticDataCollectionHelper.getStatisticTraceId(messageContext));
            dataUnit.setCurrentIndex(StatisticDataCollectionHelper.getParentFlowPosition(messageContext, null));
            FaultEvent faultEvent = new FaultEvent(dataUnit);
            addEventAndIncrementCount(messageContext, faultEvent);
        }
    }
}
Also used : FaultEvent(org.apache.synapse.aspects.flow.statistics.log.templates.FaultEvent) BasicStatisticDataUnit(org.apache.synapse.aspects.flow.statistics.data.raw.BasicStatisticDataUnit)

Aggregations

BasicStatisticDataUnit (org.apache.synapse.aspects.flow.statistics.data.raw.BasicStatisticDataUnit)1 FaultEvent (org.apache.synapse.aspects.flow.statistics.log.templates.FaultEvent)1