use of org.apache.axis2.transport.base.MetricsCollector in project wso2-axis2-transports by wso2.
the class ProcessPacketTask method run.
public void run() {
MetricsCollector metrics = endpoint.getMetrics();
try {
InputStream inputStream = new ByteArrayInputStream(data, 0, length);
MessageContext msgContext = endpoint.createMessageContext();
SOAPEnvelope envelope = TransportUtils.createSOAPMessage(msgContext, inputStream, endpoint.getContentType());
msgContext.setEnvelope(envelope);
if (outInfo != null) {
if (outInfo.getContentType() == null) {
outInfo.setContentType(endpoint.getContentType());
}
msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, outInfo);
}
AxisEngine.receive(msgContext);
metrics.incrementMessagesReceived();
metrics.incrementBytesReceived(length);
} catch (Exception ex) {
metrics.incrementFaultsReceiving();
StringBuilder buffer = new StringBuilder("Error during processing of datagram:\n");
Utils.hexDump(buffer, data, length);
log.error(buffer.toString(), ex);
}
}
Aggregations