@Override public BeforeSentRemoteEvent create(final IValueDeserializer deserializer) throws RecordInstantiationException { return new BeforeSentRemoteEvent(deserializer); }
/** * After a request creation with a RestTemplate, we get the current traceId * and orderIndex and add them to the Http header of our message. Also, we * create a new BeforeSentEvent, which we pass to the MonitoringController. */ @AfterReturning(pointcut = "requestCreation()", returning = "request") public void doAfterRequestCreation(final ClientHttpRequest request) { final long traceId = TRACEREGISTRY.getTrace().getTraceId(); final int orderIndex = TRACEREGISTRY.getTrace().getNextOrderId(); final HttpHeaders headers = request.getHeaders(); headers.add(KIEKER_TRACE_ID_HEADER, Long.toString(traceId)); headers.add(KIEKER_ORDER_INDEX_HEADER, Integer.toString(orderIndex)); CTRLINST.newMonitoringRecord(new BeforeSentRemoteEvent(TIME.getTime(), traceId, orderIndex, TECHNOLOGY)); }